Luca Prete | 2ee1960 | 2016-10-27 12:52:41 +0200 | [diff] [blame] | 1 | --- |
| 2 | # |
| 3 | # Creates the user sdn with password rocks and makes it sudoer with no password required. |
| 4 | # |
| 5 | - name: Creating user sdn |
| 6 | user: |
| 7 | name: sdn |
| 8 | password: $6$rounds=656000$$tQyVAYDTqrDRTe2q6ZHKVmlBcd2rt0BYipETg85L2BHq.Hc8xJkj.qOyApnIqVt/mr2JGwbhx1nnL1d3mubYw0 |
| 9 | generate_ssh_key: yes |
| 10 | ssh_key_bits: 2048 |
| 11 | ssh_key_file: .ssh/id_rsa |
| 12 | shell: /bin/bash |
| 13 | |
| 14 | - name: Adding user sdn to sudoers with no password required |
| 15 | lineinfile: |
| 16 | dest: "/etc/sudoers.d/sdn" |
| 17 | line: "sdn ALL=(ALL) NOPASSWD:ALL" |
| 18 | state: present |
| 19 | create: yes |