Skip to content
Snippets Groups Projects
Commit 7b21ed31 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting

parent ac762682
No related branches found
No related tags found
No related merge requests found
......@@ -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'
---
# 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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment