diff --git a/defaults/main.yml b/defaults/main.yml index acfc252d261cb44196f3e35f01a1d6de2645b009..0c1c1e1c4c2194da55a99978c1103047df7deca7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1 +1,3 @@ +--- + tunnel_user_name: systunnel diff --git a/tasks/main.yml b/tasks/main.yml index 6be22f9c06171b6cf3055ecf4f4efeb6ab39c0b1..cf351c77b6b12f1748386f7fe7d3eff051205e31 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,54 +3,54 @@ - name: Common Connect Role set_fact: - role_commonconnect_started: true + role_commonconnect_started: yes tags: - always - block: - - name: Create The /etc/hosts File - template: - src: etc_hosts.jinja2 - dest: /etc/hosts - owner: root - group: root - mode: 0644 - - - name: Copy SSH Config For Server-To-Server Communication For Admins - template: - src: ssh_config.jinja2 - dest: /home/{{ item }}/.ssh/config - owner: '{{ item }}' - group: root - mode: 0644 - with_flattened: - - {{ admins|default([]) }} - - {{ jailusers|default([]) }} - - - block: - - - name: Read available variable cache files - shell: ls ~/.ansible/hostvars - become: no - register: variable_files - failed_when: false - changed_when: false - ignore_errors: true + - name: Create The /etc/hosts File + template: + src: etc_hosts.jinja2 + dest: /etc/hosts + owner: root + group: root + mode: 0644 + + - name: Copy SSH Config For Server-To-Server Communication For Admins + template: + src: ssh_config.jinja2 + dest: /home/{{ item }}/.ssh/config + owner: '{{ item }}' + group: root + mode: 0644 + with_flattened: + - '{{ admins|default([]) }}' + - '{{ jailusers|default([]) }}' + + - block: + + - name: Read available variable cache files + shell: ls ~/.ansible/hostvars + become: no + register: variable_files + failed_when: no + changed_when: no + ignore_errors: yes + tags: + - always + + - include_tasks: more.yml + with_items: '{{ variable_files.stdout_lines|default([]) }}' + loop_control: + loop_var: inventory_name + + when: lookup('pipe','hostname') == inventory_hostname + + - name: Remember that this role had been run + set_fact: + role_commonconnect_completed: yes tags: - always - - include_tasks: more.yml - with_items: '{{ variable_files.stdout_lines|default([]) }}' - loop_control: - loop_var: inventory_name - - when: lookup('pipe','hostname') == inventory_hostname - - - name: Remember that this role had been run - set_fact: - role_commonconnect_completed: true - tags: - - always - when: not excluded_roles or "commonconnect" not in excluded_roles and role_commonconnect_completed is not defined