fix use of ansible tags (#6316)

tags are not inherited for include_role therefore the change
from include to import

Co-authored-by: Hans Feldt <hafe@users.noreply.github.com>
pull/6328/head
Hans Feldt 2020-06-25 12:00:37 +02:00 committed by GitHub
parent c29b21717d
commit 93951f2ed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 2 deletions

View File

@ -4,6 +4,7 @@
- hosts: all - hosts: all
gather_facts: false gather_facts: false
tags: always
tasks: tasks:
- name: "Set up proxy environment" - name: "Set up proxy environment"
set_fact: set_fact:
@ -31,6 +32,7 @@
- { role: bootstrap-os, tags: bootstrap-os} - { role: bootstrap-os, tags: bootstrap-os}
- name: Gather facts - name: Gather facts
tags: always
import_playbook: facts.yml import_playbook: facts.yml
- hosts: k8s-cluster:etcd - hosts: k8s-cluster:etcd

View File

@ -4,6 +4,7 @@
# Thanks https://medium.com/opsops/ansible-default-ipv4-is-not-what-you-think-edb8ab154b10 # Thanks https://medium.com/opsops/ansible-default-ipv4-is-not-what-you-think-edb8ab154b10
- name: Gather ansible_default_ipv4 from all hosts - name: Gather ansible_default_ipv4 from all hosts
tags: always
include_tasks: fallback_ips_gather.yml include_tasks: fallback_ips_gather.yml
when: hostvars[delegate_host_to_gather_facts].ansible_default_ipv4 is not defined when: hostvars[delegate_host_to_gather_facts].ansible_default_ipv4 is not defined
loop: "{{ groups['all'] }}" loop: "{{ groups['all'] }}"

View File

@ -7,7 +7,7 @@
# do not run gather facts when bootstrap-os in roles # do not run gather facts when bootstrap-os in roles
- name: set fallback_ips - name: set fallback_ips
include_tasks: fallback_ips.yml import_tasks: fallback_ips.yml
when: when:
- "'bootstrap-os' not in ansible_play_role_names" - "'bootstrap-os' not in ansible_play_role_names"
- fallback_ips is not defined - fallback_ips is not defined
@ -15,7 +15,7 @@
- always - always
- name: set no_proxy - name: set no_proxy
include_tasks: no_proxy.yml import_tasks: no_proxy.yml
when: when:
- "'bootstrap-os' not in ansible_play_role_names" - "'bootstrap-os' not in ansible_play_role_names"
- http_proxy is defined or https_proxy is defined - http_proxy is defined or https_proxy is defined

View File

@ -4,6 +4,7 @@
- hosts: all - hosts: all
gather_facts: false gather_facts: false
tags: always
tasks: tasks:
- name: "Set up proxy environment" - name: "Set up proxy environment"
set_fact: set_fact:
@ -32,6 +33,7 @@
- { role: bootstrap-os, tags: bootstrap-os} - { role: bootstrap-os, tags: bootstrap-os}
- name: Gather facts - name: Gather facts
tags: always
import_playbook: facts.yml import_playbook: facts.yml
- name: Generate the etcd certificates beforehand - name: Generate the etcd certificates beforehand

View File

@ -4,6 +4,7 @@
- hosts: all - hosts: all
gather_facts: false gather_facts: false
tags: always
tasks: tasks:
- name: "Set up proxy environment" - name: "Set up proxy environment"
set_fact: set_fact:
@ -35,6 +36,7 @@
- { role: bootstrap-os, tags: bootstrap-os} - { role: bootstrap-os, tags: bootstrap-os}
- name: Gather facts - name: Gather facts
tags: always
import_playbook: facts.yml import_playbook: facts.yml
- name: Download images to ansible host cache via first kube-master node - name: Download images to ansible host cache via first kube-master node