change hostname to ansible_hostname
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
- name: Check if app data directory exists
|
- name: Check if app data directory exists
|
||||||
stat:
|
stat:
|
||||||
path: "/app/{{ hostname }}"
|
path: "/app/{{ ansible_hostname }}"
|
||||||
register: app_stat
|
register: app_stat
|
||||||
|
|
||||||
- name: Restore Wiapp datakmd Dir
|
- name: Restore Wiapp datakmd Dir
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / restore latest
|
restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / restore latest
|
||||||
args:
|
args:
|
||||||
chdir: /home/restic
|
chdir: /home/restic
|
||||||
creates: "/app/{{ hostname }}"
|
creates: "/app/{{ ansible_hostname }}"
|
||||||
when: not app_stat.stat.exists or not app_stat.stat.isdir
|
when: not app_stat.stat.exists or not app_stat.stat.isdir
|
||||||
|
|
||||||
- name: Reload systemd daemon
|
- name: Reload systemd daemon
|
||||||
@@ -42,6 +42,6 @@
|
|||||||
|
|
||||||
- name: Start App Service
|
- name: Start App Service
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ hostname }}"
|
name: "{{ ansible_hostname }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
Reference in New Issue
Block a user