diff --git a/ansible_version.yml b/ansible_version.yml new file mode 100644 index 000000000..982880e2f --- /dev/null +++ b/ansible_version.yml @@ -0,0 +1,15 @@ +--- +- hosts: localhost + gather_facts: false + become: no + vars: + minimal_ansible_version: 2.8.0 + ansible_connection: local + tasks: + - name: "Check ansible version >={{ minimal_ansible_version }}" + assert: + msg: "Ansible must be {{ minimal_ansible_version }} or higher" + that: + - ansible_version.string is version(minimal_ansible_version, ">=") + tags: + - check diff --git a/cluster.yml b/cluster.yml index 5573c6975..ca828206c 100644 --- a/cluster.yml +++ b/cluster.yml @@ -1,17 +1,6 @@ --- -- hosts: localhost - gather_facts: false - become: no - tasks: - - name: "Check ansible version >=2.7.8" - assert: - msg: "Ansible must be v2.7.8 or higher" - that: - - ansible_version.string is version("2.7.8", ">=") - tags: - - check - vars: - ansible_connection: local +- name: Check ansible version + import_playbook: ansible_version.yml - hosts: all gather_facts: false diff --git a/mitogen.yaml b/mitogen.yaml index 853c39f9c..d8d308794 100644 --- a/mitogen.yaml +++ b/mitogen.yaml @@ -1,9 +1,13 @@ --- +- name: Check ansible version + import_playbook: ansible_version.yml + - hosts: localhost strategy: linear vars: mitogen_version: master mitogen_url: https://github.com/dw/mitogen/archive/{{ mitogen_version }}.zip + ansible_connection: local tasks: - name: Create mitogen plugin dir file: diff --git a/recover-control-plane.yml b/recover-control-plane.yml index aca777ae1..fe8f74e8a 100644 --- a/recover-control-plane.yml +++ b/recover-control-plane.yml @@ -1,17 +1,6 @@ --- -- hosts: localhost - gather_facts: False - become: no - tasks: - - name: "Check ansible version >=2.7.8" - assert: - msg: "Ansible must be v2.7.8 or higher" - that: - - ansible_version.string is version("2.7.8", ">=") - tags: - - check - vars: - ansible_connection: local +- name: Check ansible version + import_playbook: ansible_version.yml - hosts: bastion[0] gather_facts: False diff --git a/remove-node.yml b/remove-node.yml index db6f90529..ee6956dcc 100644 --- a/remove-node.yml +++ b/remove-node.yml @@ -1,17 +1,6 @@ --- -- hosts: localhost - become: no - gather_facts: no - tasks: - - name: "Check ansible version >=2.7.8" - assert: - msg: "Ansible must be v2.7.8 or higher" - that: - - ansible_version.string is version("2.7.8", ">=") - tags: - - check - vars: - ansible_connection: local +- name: Check ansible version + import_playbook: ansible_version.yml - hosts: "{{ node | default('etcd:k8s-cluster:calico-rr') }}" gather_facts: no diff --git a/reset.yml b/reset.yml index 21c92f789..cf64c2f34 100644 --- a/reset.yml +++ b/reset.yml @@ -1,17 +1,6 @@ --- -- hosts: localhost - become: no - gather_facts: False - tasks: - - name: "Check ansible version >=2.7.8" - assert: - msg: "Ansible must be v2.7.8 or higher" - that: - - ansible_version.string is version("2.7.8", ">=") - tags: - - check - vars: - ansible_connection: local +- name: Check ansible version + import_playbook: ansible_version.yml - hosts: bastion[0] gather_facts: False diff --git a/scale.yml b/scale.yml index 1dc7eb60c..65fecae0e 100644 --- a/scale.yml +++ b/scale.yml @@ -1,17 +1,6 @@ --- -- hosts: localhost - gather_facts: False - become: no - tasks: - - name: "Check ansible version >=2.7.8" - assert: - msg: "Ansible must be v2.7.8 or higher" - that: - - ansible_version.string is version("2.7.8", ">=") - tags: - - check - vars: - ansible_connection: local +- name: Check ansible version + import_playbook: ansible_version.yml - hosts: all gather_facts: false diff --git a/upgrade-cluster.yml b/upgrade-cluster.yml index 83c1502c3..70c3943fe 100644 --- a/upgrade-cluster.yml +++ b/upgrade-cluster.yml @@ -1,17 +1,6 @@ --- -- hosts: localhost - gather_facts: false - become: no - tasks: - - name: "Check ansible version >=2.7.8" - assert: - msg: "Ansible must be v2.7.8 or higher" - that: - - ansible_version.string is version("2.7.8", ">=") - tags: - - check - vars: - ansible_connection: local +- name: Check ansible version + import_playbook: ansible_version.yml - hosts: all gather_facts: false