Skip to content

Commit c292fcc

Browse files
committed
Move generic tasks outside of the vagrant provisioner
Signed-off-by: Xavi Hernandez <[email protected]>
1 parent 1f9f976 commit c292fcc

File tree

2 files changed

+11
-13
lines changed
  • playbooks/roles

2 files changed

+11
-13
lines changed

playbooks/roles/local.defaults/tasks/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,14 @@
7676
groups: "{{ config.nodes[item].groups + ['site'] }}"
7777
site: "{{ config.nodes[item] }}"
7878
with_items: "{{ config.nodes.keys() }}"
79+
80+
- name: Create state directory structure on host
81+
file:
82+
path: "{{ config.statedir }}/{{ item }}"
83+
state: directory
84+
loop: "{{ groups['site'] }}"
85+
86+
- name: Copy common playbook configuration
87+
copy:
88+
src: ansible/config.yml
89+
dest: "{{ config.statedir }}"

playbooks/roles/provisioner.vagrant/tasks/create/main.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,3 @@
2626
name: "{{ item }}"
2727
ansible_host: "{{ (hostvars[item].vm_ip.stdout | from_json)[0].addr_info[0].local }}"
2828
with_items: "{{ ansible_play_hosts }}"
29-
30-
- name: Create state directory structure on host
31-
run_once: true
32-
file:
33-
path: "{{ config.statedir }}/{{ item }}"
34-
state: directory
35-
loop: "{{ config.groups['cluster'] + config.groups['clients'] }}"
36-
37-
- name: Copy common playbook configuration
38-
run_once: true
39-
copy:
40-
src: ansible/config.yml
41-
dest: "{{ config.statedir }}"

0 commit comments

Comments
 (0)