diff --git a/tasks/main.yml b/tasks/main.yml index ce8e87a2c9fdd74fd1cd0d73c256de43dfca7d1d..407965bd1e3bba114a22b1a71695efc9cf780889 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,7 +2,8 @@ # file: roles/commonconnect/tasks/main.yml - name: "Common Connect Role" - set_fact: role_commonconnect_started=true + set_fact: + role_commonconnect_started: true tags: 'always' - block: @@ -29,7 +30,7 @@ - block: - name: "Read available variable cache files" - shell: ls ~/.ansible/hostvars + shell: 'ls ~/.ansible/hostvars' become: no register: variable_files failed_when: false @@ -37,7 +38,7 @@ ignore_errors: true tags: 'always' - - include_tasks: more.yml + - include_tasks: 'more.yml' with_items: '{{ variable_files.stdout_lines|default([]) }}' loop_control: loop_var: inventory_name @@ -45,7 +46,8 @@ when: lookup('pipe','hostname') == inventory_hostname - name: 'Remember that this role had been run' - set_fact: role_commonconnect_completed=true + set_fact: + role_commonconnect_completed: true tags: 'always' when: '"commonconnect" not in excluded_roles and role_commonconnect_completed is not defined' diff --git a/tasks/more.yml b/tasks/more.yml index d60a07e730242f4c62650fd932f8fae4ebfcec6c..a869ceb437baf1de8fffc13cf6a96db1bb9e4c70 100644 --- a/tasks/more.yml +++ b/tasks/more.yml @@ -1,7 +1,9 @@ --- # file: roles/commonconnect/tasks/more.yml -- set_fact: facts="{{ lookup('file','~/.ansible/hostvars/{{ inventory_name }}') | from_json }}" +- name: "Set facts" + set_fact: + facts: "{{ lookup('file','~/.ansible/hostvars/{{ inventory_name }}') | from_json }}" - name: "Add Hosts to Hostfile" lineinfile: