Unify some homebrew roles' become methods

This commit is contained in:
Salt 2020-11-08 00:05:48 -06:00
parent f893458e51
commit ddc5c881de
5 changed files with 29 additions and 37 deletions

View File

@ -1,7 +1,5 @@
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
# vim:ft=ansible: # vim:ft=ansible:
- name: configure ansible-pull
block:
- name: assure vault password file - name: assure vault password file
copy: src=vaultpass dest="~/ansiblevaultpass" mode="0600" copy: src=vaultpass dest="~/ansiblevaultpass" mode="0600"
become: yes become: yes
@ -17,4 +15,3 @@
- name: enable timer - name: enable timer
systemd: daemon_reload=yes name=ansible-pull.timer enabled=yes state=started systemd: daemon_reload=yes name=ansible-pull.timer enabled=yes state=started
notify: restart ansiblepull timer notify: restart ansiblepull timer
become: yes

View File

@ -1,7 +1,5 @@
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
# vim:ft=ansible: # vim:ft=ansible:
- name: configure ansible user
block:
- name: create ansible user - name: create ansible user
user: name=ansible password_lock=yes user: name=ansible password_lock=yes
- name: configure ansible user home directory - name: configure ansible user home directory
@ -10,4 +8,3 @@
authorized_key: user=ansible manage_dir=yes key={{ common_ansible_pubkey }} authorized_key: user=ansible manage_dir=yes key={{ common_ansible_pubkey }}
- name: configure ansible user sudo - name: configure ansible user sudo
lineinfile: path=/etc/sudoers line="ansible ALL=(ALL:ALL) NOPASSWD:ALL" lineinfile: path=/etc/sudoers line="ansible ALL=(ALL:ALL) NOPASSWD:ALL"
become: yes

View File

@ -28,5 +28,4 @@
- whois - whois
- name: remove basic packages - name: remove basic packages
apt: state=absent name=unattended-upgrades apt: state=absent name=unattended-upgrades
become: yes
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"

View File

@ -1,10 +1,7 @@
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
# vim:ft=ansible: # vim:ft=ansible:
- name: configure system
block:
- name: configure hostname - name: configure hostname
hostname: name={{ inventory_hostname }} hostname: name={{ inventory_hostname }}
- name: configure timezone - name: configure timezone
timezone: name=America/Chicago timezone: name=America/Chicago
notify: restart cron notify: restart cron
become: yes

View File

@ -5,8 +5,10 @@
- hosts: all - hosts: all
roles: roles:
- role: common - role: common
become: yes
tags: [ common ] tags: [ common ]
- role: ansible-pull - role: ansible-pull
become: yes
tags: [ ansible, common ] tags: [ ansible, common ]
# Home desktops # Home desktops
- hosts: desktop - hosts: desktop