Skip to content

Commit 73867dd

Browse files
committed
Purge default nomad config from apt
1 parent 6667614 commit 73867dd

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tasks/install_linux_repo.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,12 @@
7070
name: "nomad{{ '=' if ansible_pkg_mgr == 'apt' else '-' }}{{ nomad_version }}"
7171
state: present
7272
become: true
73+
74+
- name: Remove default configuration on first install
75+
file:
76+
dest: "{{ nomad_config_dir }}/nomad.hcl"
77+
state: absent
78+
when: "'nomad' not in ansible_facts.packages"
79+
become: true
80+
notify:
81+
- restart nomad

tasks/main.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@
9090
include_tasks: tls.yml
9191
when: nomad_tls_enable | bool
9292

93+
- name: Remove default configuration
94+
file:
95+
dest: "{{ nomad_config_dir }}/nomad.hcl"
96+
state: absent
97+
when:
98+
- nomad_allow_purge_config | bool
99+
- nomad_install_from_repo | bool
100+
notify:
101+
- restart nomad
102+
93103
- name: Server configuration
94104
template:
95105
src: server.hcl.j2
@@ -146,7 +156,7 @@
146156
notify:
147157
- restart nomad
148158

149-
- name: Remove custome configuration
159+
- name: Remove custom configuration
150160
file:
151161
dest: "{{ nomad_config_dir }}/custom.json"
152162
state: absent

0 commit comments

Comments
 (0)