Skip to content

Commit

Permalink
Drop Ansible support for v2.9 and v2.10 (kubernetes-sigs#8925)
Browse files Browse the repository at this point in the history
Ansible v2.9 and v2.10 are EOL as [1].
This drops those version supports by following the upstream Ansible.

This sets use_ssh_args true always because that is required to use
ssh_args on ansible.cfg on Ansible v2.11 or later[2].

ansible_ssh_host is replaced with ansible_host because ansible_ssh_host
has been deprecated already and cenots7 jobs were failed due to the
deprecated ansible_ssh_host.

[1]: https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html#ansible-core-changelogs
[2]: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html#parameter-use_ssh_args
  • Loading branch information
oomichi authored Jun 9, 2022
1 parent f53764f commit cd7381d
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ variables:
RECOVER_CONTROL_PLANE_TEST: "false"
RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[2:],kube_control_plane[1:]"
TERRAFORM_VERSION: 1.0.8
ANSIBLE_MAJOR_VERSION: "2.10"
ANSIBLE_MAJOR_VERSION: "2.11"

before_script:
- ./tests/scripts/rebase.sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Note: Upstart/SysV init based OS types are not supported.
## Requirements

- **Minimum required version of Kubernetes is v1.21**
- **Ansible v2.9.x, Jinja 2.11+ and python-netaddr is installed on the machine that will run Ansible commands**
- **Ansible v2.11+, Jinja 2.11+ and python-netaddr is installed on the machine that will run Ansible commands**
- The target servers must have **access to the Internet** in order to pull docker images. Otherwise, additional configuration is required (See [Offline Environment](docs/offline-environment.md))
- The target servers are configured to allow **IPv4 forwarding**.
- If using IPv6 for pods and services, the target servers are configured to allow **IPv6 forwarding**.
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[ssh_connection]
pipelining=True
ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o ConnectionAttempts=100 -o UserKnownHostsFile=/dev/null
ansible_ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o ConnectionAttempts=100 -o UserKnownHostsFile=/dev/null
#control_path = ~/.ssh/ansible-%%r@%%h:%%p
[defaults]
# https://github.com/ansible/ansible/issues/56930 (to ignore group names with - and .)
Expand Down
14 changes: 1 addition & 13 deletions ansible_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
gather_facts: false
become: no
vars:
minimal_ansible_version: 2.9.0
minimal_ansible_version_2_10: 2.10.11
minimal_ansible_version: 2.11.0
maximal_ansible_version: 2.13.0
ansible_connection: local
tags: always
Expand All @@ -18,17 +17,6 @@
tags:
- check

- name: "Check Ansible version > {{ minimal_ansible_version_2_10 }} when using ansible 2.10"
assert:
msg: "When using Ansible 2.10, the minimum supported version is {{ minimal_ansible_version_2_10 }}"
that:
- ansible_version.string is version(minimal_ansible_version_2_10, ">=")
- ansible_version.string is version(maximal_ansible_version, "<")
when:
- ansible_version.string is version('2.10.0', ">=")
tags:
- check

- name: "Check that python netaddr is installed"
assert:
msg: "Python netaddr is not present"
Expand Down
2 changes: 0 additions & 2 deletions docs/ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Based on the table below and the available python version for your ansible host

| Ansible Version | Python Version |
| --------------- | -------------- |
| 2.9 | 2.7,3.5-3.8 |
| 2.10 | 2.7,3.5-3.8 |
| 2.11 | 2.7,3.5-3.9 |
| 2.12 | 3.8-3.10 |

Expand Down
10 changes: 0 additions & 10 deletions requirements-2.10.txt

This file was deleted.

10 changes: 0 additions & 10 deletions requirements-2.9.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements-2.9.yml

This file was deleted.

4 changes: 2 additions & 2 deletions roles/download/tasks/download_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
synchronize:
src: "{{ image_path_final }}"
dest: "{{ image_path_cached }}"
use_ssh_args: "{{ has_bastion | default(false) }}"
use_ssh_args: true
mode: pull
when:
- not image_is_cached
Expand All @@ -95,7 +95,7 @@
synchronize:
src: "{{ image_path_cached }}"
dest: "{{ image_path_final }}"
use_ssh_args: "{{ has_bastion | default(false) }}"
use_ssh_args: true
mode: push
delegate_facts: no
register: upload_image
Expand Down
4 changes: 2 additions & 2 deletions roles/download/tasks/download_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
synchronize:
src: "{{ file_path_cached }}"
dest: "{{ file_path_cached }}"
use_ssh_args: "{{ has_bastion | default(false) }}"
use_ssh_args: true
mode: pull
when:
- download_force_cache
Expand All @@ -114,7 +114,7 @@
synchronize:
src: "{{ file_path_cached }}"
dest: "{{ download.dest }}"
use_ssh_args: "{{ has_bastion | default(false) }}"
use_ssh_args: true
mode: push
register: get_task
until: get_task is succeeded
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[all]
{% for instance in vms.results %}
instance-{{ loop.index }} ansible_ssh_host={{instance.stdout}}
instance-{{ loop.index }} ansible_host={{instance.stdout}}
{% endfor %}

{% if mode is defined and mode in ["separate", "separate-scale"] %}
Expand Down
2 changes: 1 addition & 1 deletion tests/cloud_playbooks/wait-for-ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
tasks:
- name: Wait until SSH is available
wait_for:
host: "{{ ansible_ssh_host }}"
host: "{{ ansible_host }}"
port: 22
timeout: 240
delegate_to: localhost
11 changes: 0 additions & 11 deletions tests/requirements-2.10.txt

This file was deleted.

14 changes: 0 additions & 14 deletions tests/requirements-2.9.txt

This file was deleted.

0 comments on commit cd7381d

Please sign in to comment.