From dcc7bb5cd1c02240ad0251cf0f722171ff7c3f7c Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 11 Sep 2025 14:37:05 +0300 Subject: [PATCH 01/11] pin_ansible_version --- install.sh | 3 ++- roles/_init/defaults/main.yml | 2 ++ roles/debian/ansible/defaults/main.yml | 2 +- roles/debian/ansible/tasks/main.yml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index c8c8b8db4..938856296 100755 --- a/install.sh +++ b/install.sh @@ -84,6 +84,7 @@ FIREWALL="true" AWS_SUPPORT="false" IS_LOCAL="false" SERVER_HOSTNAME=$(hostname) +ANSIBLE_VERSION="<12" # Parse options. parse_options "$@" @@ -146,7 +147,7 @@ fi /usr/bin/echo "-------------------------------------------------" /usr/bin/su - "$CONTROLLER_USER" -c "/usr/bin/python3 -m venv /home/$CONTROLLER_USER/ce-python" /usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/python3 -m pip install --upgrade pip" -/usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install ansible netaddr python-debian" +/usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install ansible$ANSIBLE_VERSION netaddr python-debian" if [ "$AWS_SUPPORT" = "true" ]; then /usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install boto3" fi diff --git a/roles/_init/defaults/main.yml b/roles/_init/defaults/main.yml index 92b86ee63..98466218e 100644 --- a/roles/_init/defaults/main.yml +++ b/roles/_init/defaults/main.yml @@ -9,6 +9,8 @@ _venv_install_username: "{{ _ce_provision_username }}" _ce_ansible_timer_name: upgrade_ansible _env_type: unspecified +ce_ansible_version: "<12.0" + # AWS variables - if you are using an AWS account, you can preset certain variables # Generally it is recommended to place these in your ce-provision-config repository under hosts/group_vars/all #_aws_profile: example # boto profile name diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index e7256e5f8..7b98f1a2f 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -6,7 +6,7 @@ ce_ansible: #venv_install_username: ansible # user to become when creating venv upgrade: enabled: true # create systemd timer to auto-upgrade Ansible - command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too + command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible{{ ce_ansible_version }}" # if you set venv_path above then set it here too. Version is set in the _init role. on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible linters: diff --git a/roles/debian/ansible/tasks/main.yml b/roles/debian/ansible/tasks/main.yml index 57af8cbf0..7c8c1fa92 100644 --- a/roles/debian/ansible/tasks/main.yml +++ b/roles/debian/ansible/tasks/main.yml @@ -60,7 +60,7 @@ packages: - name: pip state: latest - - name: ansible + - name: "ansible{{ ce_ansible_version }}" - name: python-debian - name: Install linters. From 4131dba00f0ff693ec3bc239ad40983aedc6c763 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 11 Sep 2025 14:44:19 +0300 Subject: [PATCH 02/11] pin_ansible_version --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 938856296..c11219cbd 100755 --- a/install.sh +++ b/install.sh @@ -147,7 +147,7 @@ fi /usr/bin/echo "-------------------------------------------------" /usr/bin/su - "$CONTROLLER_USER" -c "/usr/bin/python3 -m venv /home/$CONTROLLER_USER/ce-python" /usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/python3 -m pip install --upgrade pip" -/usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install ansible$ANSIBLE_VERSION netaddr python-debian" +/usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install 'ansible$ANSIBLE_VERSION' netaddr python-debian" if [ "$AWS_SUPPORT" = "true" ]; then /usr/bin/su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install boto3" fi From eb688b00bcfcb5dee60a914c184081a19a1e0ce3 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 11 Sep 2025 15:08:51 +0300 Subject: [PATCH 03/11] pin_ansible_version --- roles/_init/defaults/main.yml | 2 -- roles/debian/ansible/defaults/main.yml | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/roles/_init/defaults/main.yml b/roles/_init/defaults/main.yml index 98466218e..92b86ee63 100644 --- a/roles/_init/defaults/main.yml +++ b/roles/_init/defaults/main.yml @@ -9,8 +9,6 @@ _venv_install_username: "{{ _ce_provision_username }}" _ce_ansible_timer_name: upgrade_ansible _env_type: unspecified -ce_ansible_version: "<12.0" - # AWS variables - if you are using an AWS account, you can preset certain variables # Generally it is recommended to place these in your ce-provision-config repository under hosts/group_vars/all #_aws_profile: example # boto profile name diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index 7b98f1a2f..4e468625d 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -1,4 +1,5 @@ --- +ce_ansible_version: "<12.0" ce_ansible: # These are usually set in the _init role using _venv_path, _venv_command and _venv_install_username but can be overridden. #venv_path: "/home/{{ ce_provision.username }}/ansible" @@ -6,7 +7,7 @@ ce_ansible: #venv_install_username: ansible # user to become when creating venv upgrade: enabled: true # create systemd timer to auto-upgrade Ansible - command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible{{ ce_ansible_version }}" # if you set venv_path above then set it here too. Version is set in the _init role. + command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade 'ansible{{ ce_ansible_version }}'" # if you set venv_path above then set it here too. Version is set in the _init role. on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible linters: From 2b911a09ae65ddb128458075bf8a66a06314f1fe Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 11 Sep 2025 15:12:25 +0300 Subject: [PATCH 04/11] pin_ansible_version --- roles/debian/ansible/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index 4e468625d..cd00438c8 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -7,7 +7,7 @@ ce_ansible: #venv_install_username: ansible # user to become when creating venv upgrade: enabled: true # create systemd timer to auto-upgrade Ansible - command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade 'ansible{{ ce_ansible_version }}'" # if you set venv_path above then set it here too. Version is set in the _init role. + command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade 'ansible{{ ce_ansible_version }}'" # if you set venv_path above then set it here too. on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible linters: From ff940a958f2edc668aaf3b1e50e282fdcde5cc33 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 11 Sep 2025 16:37:57 +0300 Subject: [PATCH 05/11] pin_ansible_version_fix_upgrade_timer --- roles/debian/ansible/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index cd00438c8..33a331751 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -7,7 +7,7 @@ ce_ansible: #venv_install_username: ansible # user to become when creating venv upgrade: enabled: true # create systemd timer to auto-upgrade Ansible - command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade 'ansible{{ ce_ansible_version }}'" # if you set venv_path above then set it here too. + command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade {{ 'ansible' ~ ce_ansible_version | quote }}" # if you set venv_path above then set it here too. on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible linters: From 45a3642f96c6a8e6f7b0d7073ef9fc63c5f8c761 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 11 Sep 2025 17:10:37 +0300 Subject: [PATCH 06/11] pin_ansible_version_fix_upgrade_timer --- roles/debian/ansible/defaults/main.yml | 2 +- roles/debian/ansible/tasks/main.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index 33a331751..2be4f5a9c 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -7,7 +7,7 @@ ce_ansible: #venv_install_username: ansible # user to become when creating venv upgrade: enabled: true # create systemd timer to auto-upgrade Ansible - command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade {{ 'ansible' ~ ce_ansible_version | quote }}" # if you set venv_path above then set it here too. + command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible{{ ce_ansible_version }}" # if you set venv_path above then set it here too. on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible linters: diff --git a/roles/debian/ansible/tasks/main.yml b/roles/debian/ansible/tasks/main.yml index 7c8c1fa92..2a7742f30 100644 --- a/roles/debian/ansible/tasks/main.yml +++ b/roles/debian/ansible/tasks/main.yml @@ -86,8 +86,7 @@ block: - name: Build systemd timer variables string. ansible.builtin.set_fact: - _timer: "{'{{ ce_ansible.upgrade.timer_name | default(_ce_ansible_timer_name) }}': { timer_command: '{{ ce_ansible.upgrade.command }}', timer_OnCalendar: '{{ ce_ansible.upgrade.on_calendar }}' }}" - + _timer: "{'{{ ce_ansible.upgrade.timer_name | default(_ce_ansible_timer_name) }}': { timer_command: {{ ce_ansible.upgrade.command | quote }}, timer_OnCalendar: '{{ ce_ansible.upgrade.on_calendar }}' }}" - name: Turn the timer string into a dictionary. ansible.builtin.set_fact: _timer: "{{ _timer.splitlines() | map('from_yaml') | list }}" From e00547251c3ae0ffcb687bdf38ad7bfd80c0a489 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 11 Sep 2025 18:22:00 +0300 Subject: [PATCH 07/11] pin_ansible_version_fix_upgrade_timer --- roles/debian/ansible/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/debian/ansible/tasks/main.yml b/roles/debian/ansible/tasks/main.yml index 2a7742f30..c0cf40389 100644 --- a/roles/debian/ansible/tasks/main.yml +++ b/roles/debian/ansible/tasks/main.yml @@ -86,7 +86,7 @@ block: - name: Build systemd timer variables string. ansible.builtin.set_fact: - _timer: "{'{{ ce_ansible.upgrade.timer_name | default(_ce_ansible_timer_name) }}': { timer_command: {{ ce_ansible.upgrade.command | quote }}, timer_OnCalendar: '{{ ce_ansible.upgrade.on_calendar }}' }}" + _timer: "{'{{ ce_ansible.upgrade.timer_name | default(_ce_ansible_timer_name) }}': { timer_command: '{{ ce_ansible.upgrade.command | quote }}'', timer_OnCalendar: '{{ ce_ansible.upgrade.on_calendar }}' }}" - name: Turn the timer string into a dictionary. ansible.builtin.set_fact: _timer: "{{ _timer.splitlines() | map('from_yaml') | list }}" From a670aaa1f3e2fdf3394a2104782a02e0f0256032 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 12 Sep 2025 16:01:47 +0300 Subject: [PATCH 08/11] pin_ansible_version_disable_upgrade_timer --- roles/debian/ansible/defaults/main.yml | 6 +++--- roles/debian/ansible/tasks/main.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index 2be4f5a9c..88984cc15 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -1,13 +1,13 @@ --- -ce_ansible_version: "<12.0" ce_ansible: # These are usually set in the _init role using _venv_path, _venv_command and _venv_install_username but can be overridden. #venv_path: "/home/{{ ce_provision.username }}/ansible" #venv_command: /usr/bin/python3.11 -m venv #venv_install_username: ansible # user to become when creating venv + ansible_version: "<12.0" # also check install.sh script in the repo root and set the version there accordingly. upgrade: - enabled: true # create systemd timer to auto-upgrade Ansible - command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible{{ ce_ansible_version }}" # if you set venv_path above then set it here too. + enabled: false # create systemd timer to auto-upgrade Ansible. Temporary disabled due to ansible 2.19 breaking changes. + command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too. on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible linters: diff --git a/roles/debian/ansible/tasks/main.yml b/roles/debian/ansible/tasks/main.yml index c0cf40389..393deb45a 100644 --- a/roles/debian/ansible/tasks/main.yml +++ b/roles/debian/ansible/tasks/main.yml @@ -60,7 +60,7 @@ packages: - name: pip state: latest - - name: "ansible{{ ce_ansible_version }}" + - name: "ansible{{ ce_ansible.ansible_version }}" - name: python-debian - name: Install linters. @@ -86,7 +86,7 @@ block: - name: Build systemd timer variables string. ansible.builtin.set_fact: - _timer: "{'{{ ce_ansible.upgrade.timer_name | default(_ce_ansible_timer_name) }}': { timer_command: '{{ ce_ansible.upgrade.command | quote }}'', timer_OnCalendar: '{{ ce_ansible.upgrade.on_calendar }}' }}" + _timer: "{'{{ ce_ansible.upgrade.timer_name | default(_ce_ansible_timer_name) }}': { timer_command: '{{ ce_ansible.upgrade.command }}', timer_OnCalendar: '{{ ce_ansible.upgrade.on_calendar }}' }}" - name: Turn the timer string into a dictionary. ansible.builtin.set_fact: _timer: "{{ _timer.splitlines() | map('from_yaml') | list }}" From 61af359c1ce2364741712a098e78ea82b32111a4 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 12 Sep 2025 16:03:43 +0300 Subject: [PATCH 09/11] pin_ansible_version_disable_upgrade_timer --- roles/debian/ansible/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index 88984cc15..40a497d2a 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -7,7 +7,7 @@ ce_ansible: ansible_version: "<12.0" # also check install.sh script in the repo root and set the version there accordingly. upgrade: enabled: false # create systemd timer to auto-upgrade Ansible. Temporary disabled due to ansible 2.19 breaking changes. - command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too. + command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible linters: From bf955ba113e1ea4e869b97cc9a1154ecf978bf1e Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 12 Sep 2025 16:05:16 +0300 Subject: [PATCH 10/11] pin_ansible_version_disable_upgrade_timer --- roles/debian/ansible/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/debian/ansible/tasks/main.yml b/roles/debian/ansible/tasks/main.yml index 393deb45a..cdf6d0862 100644 --- a/roles/debian/ansible/tasks/main.yml +++ b/roles/debian/ansible/tasks/main.yml @@ -87,6 +87,7 @@ - name: Build systemd timer variables string. ansible.builtin.set_fact: _timer: "{'{{ ce_ansible.upgrade.timer_name | default(_ce_ansible_timer_name) }}': { timer_command: '{{ ce_ansible.upgrade.command }}', timer_OnCalendar: '{{ ce_ansible.upgrade.on_calendar }}' }}" + - name: Turn the timer string into a dictionary. ansible.builtin.set_fact: _timer: "{{ _timer.splitlines() | map('from_yaml') | list }}" From 20e9d292574784574bd5f3652d300ffc25610f01 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 12 Sep 2025 16:09:39 +0300 Subject: [PATCH 11/11] pin_ansible_version_disable_upgrade_timer --- roles/debian/ansible/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/debian/ansible/defaults/main.yml b/roles/debian/ansible/defaults/main.yml index 40a497d2a..47707d7d0 100644 --- a/roles/debian/ansible/defaults/main.yml +++ b/roles/debian/ansible/defaults/main.yml @@ -6,7 +6,7 @@ ce_ansible: #venv_install_username: ansible # user to become when creating venv ansible_version: "<12.0" # also check install.sh script in the repo root and set the version there accordingly. upgrade: - enabled: false # create systemd timer to auto-upgrade Ansible. Temporary disabled due to ansible 2.19 breaking changes. + enabled: false # create systemd timer to auto-upgrade Ansible. Temporary disabled due to ansible 2.19 breaking changes. command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too on_calendar: "*-*-* 01:30:00" # see systemd.time documentation - https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#Calendar%20Events #timer_name: upgrade_ansible