You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
695 B

---
- name: Make sure we have a 'wheel' group
group:
name: wheel
state: present
- name: Allow 'wheel' group to have passwordless sudo
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%wheel'
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'
when: ansible_user == "root"
- name: Add user to wheel group
user:
name: "{{username}}"
groups:
- wheel
append: yes
state: present
createhome: yes
shell: /bin/bash
when: ansible_user == "root"
- name: Set authorized key for user
authorized_key:
user: "{{username}}"
state: present
key: "{{github_ssh_key_url}}"
when: github_ssh_key_url != None