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 config dir /etc/docker/compose-{{dco_svc_name}}
10 path: "/etc/docker/compose-{{dco_svc_name}}"
17 # fail here, if wrong dco_svc_name given
18 - name: copy config dirtree for service {{dco_svc_name}}
20 path: "/etc/docker/compose-{{dco_svc_name}}/{{item.path}}"
25 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/svc-{{dco_svc_name}}/config/"
26 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/svc-{{dco_svc_name}}/config/"
27 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/svc-{{dco_svc_name}}/config/"
28 - "default/svc-{{dco_svc_name}}/config/"
29 when: item.state == 'directory'
30 notify: restart docker-compose@{{dco_svc_name}}.service
33 - name: copy config filetree for service {{dco_svc_name}}
36 dest: "/etc/docker/compose-{{dco_svc_name}}/{{item.path}}"
40 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/svc-{{dco_svc_name}}/config/"
41 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/svc-{{dco_svc_name}}/config/"
42 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/svc-{{dco_svc_name}}/config/"
43 - "default/svc-default/config/"
44 when: item.state == 'file'
45 notify: restart docker-compose@{{dco_svc_name}}.service
48 - name: create volume dir for service {{dco_svc_name}}
50 path: "/srv/docker-compose/svc-{{dco_svc_name}}"
57 - name: copy volume dirtree for service {{dco_svc_name}}
59 path: "/srv/docker-compose/svc-{{dco_svc_name}}/{{item.path}}"
64 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/svc-{{dco_svc_name}}/volumes/"
65 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/svc-{{dco_svc_name}}/volumes/"
66 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/svc-{{dco_svc_name}}/volumes/"
67 - "default/svc-default/volumes/"
68 when: item.state == 'directory'
69 notify: restart docker-compose@{{dco_svc_name}}.service
72 - name: copy volume filetree for service {{dco_svc_name}}
75 dest: "/srv/docker-compose/svc-{{dco_svc_name}}/{{item.path}}"
79 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/svc-{{dco_svc_name}}/volumes/"
80 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/svc-{{dco_svc_name}}/volumes/"
81 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/svc-{{dco_svc_name}}/volumes/"
82 - "default/svc-default/volumes/"
83 when: item.state == 'file'
84 notify: restart docker-compose@{{dco_svc_name}}.service
87 - name: enable and start docker-compose@{{dco_svc_name}}.service
89 name: docker-compose@{{dco_svc_name}}.service
93 when: dco_svc_cron == ''
96 - name: generate docker-compose-{{dco_svc_name}}.timer
99 dest: "/etc/systemd/system/docker-compose-{{dco_svc_name}}.timer"
104 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/docker-compose.timer.j2"
105 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/docker-compose.timer.j2"
106 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/docker-compose.timer.j2"
107 - "default/docker-compose.timer.j2"
108 when: dco_svc_cron != ''
111 - name: enable and start docker-compose-{{dco_svc_name}}.timer
113 name: docker-compose-{{dco_svc_name}}.timer
117 when: dco_svc_cron != ''