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>
8 - name: create {{user.name}} user
11 home: "{{user.home | default ('/home/'+user.name)}}"
12 shell: "{{user.shell | default ('/bin/bash')}}"
13 groups: "{{user.groups | default ('')}}"
19 - name: create {{user.name}} user's homedir
21 path: "{{user.home | default ('/home/'+user.name)}}"
23 mode: "{{user.homemode | default ('0750')}}"
24 owner: "{{user.name}}"
25 group: "{{user.name}}"
28 - name: copy {{user.name}}'s .profile
31 dest: "{{user.home | default ('/home/'+user.name)}}/.profile"
32 force: "{{user.force | default ('no')}}"
34 owner: "{{user.name}}"
35 group: "{{user.name}}"
37 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{user.name}}/profile"
38 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{user.name}}/profile"
39 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{user.name}}/profile"
40 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/profile"
41 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/profile"
42 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/profile"
46 - name: symlink {{user.name}}'s .zprofile to .profile
48 src: "{{user.home | default ('/home/'+user.name)}}/.profile"
49 dest: "{{user.home | default ('/home/'+user.name)}}/.zshrc"
50 force: "{{user.force | default ('no')}}"
52 owner: "{{user.name}}"
53 group: "{{user.name}}"
58 - name: create {{user.name}}'s .ssh dir
60 path: "{{user.home | default ('/home/'+user.name)}}/.ssh"
63 owner: "{{user.name}}"
64 group: "{{user.name}}"
67 - name: copy {{user.name}}'s .ssh/config
70 dest: "{{user.home | default ('/home/'+user.name)}}/.ssh/config"
71 force: "{{user.force | default ('no')}}"
73 owner: "{{user.name}}"
74 group: "{{user.name}}"
76 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{user.name}}/ssh_config"
77 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{user.name}}/ssh_config"
78 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{user.name}}/ssh_config"
79 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/ssh_config"
80 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/ssh_config"
81 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/ssh_config"
82 - "default/ssh_config"
85 - name: copy {{user.name}}'s authorized_keys
88 dest: "{{user.home | default ('/home/'+user.name)}}/.ssh/authorized_keys"
89 force: "{{user.force | default ('no')}}"
91 owner: "{{user.name}}"
92 group: "{{user.name}}"
94 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{user.name}}/authorized_keys"
95 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{user.name}}/authorized_keys"
96 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{user.name}}/authorized_keys"
97 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/authorized_keys"
98 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/authorized_keys"
99 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/authorized_keys"
100 - "default/authorized_keys"