1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
7 # sudo-user for remote provisioning and periodic local provisioning.
18 ignore_errors: "{{ignore_online_errors | bool}}"
21 - name: create ansible public-files dir
23 path: "/opt/somesible"
30 - name: create ansible user
42 - name: create ansible user's homedir
51 - name: add ansible to sudoers
54 dest: "/etc/sudoers.d/ansible"
58 validate: /usr/sbin/visudo -cf %s
60 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sudoers.d.ansible"
61 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sudoers.d.ansible"
62 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sudoers.d.ansible"
63 - "default/sudoers.d.ansible"
66 - name: override default sudoers file
73 validate: /usr/sbin/visudo -cf %s
75 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sudoers"
76 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sudoers"
77 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sudoers"
81 - name: set ansible .ssh-dir permissions
83 path: "/var/ansible/.ssh"
90 - name: copy authorized_keys
93 dest: "/var/ansible/.ssh/authorized_keys"
98 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/authorized_keys"
99 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/authorized_keys"
100 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/authorized_keys"
101 - "default/authorized_keys"