Skip to content
Snippets Groups Projects
Verified Commit 8906204e authored by Chris Croome's avatar Chris Croome
Browse files

update for ANSIBLE_INJECT_FACT_VARS: "0"

parent 0791c4fb
No related branches found
No related tags found
No related merge requests found
Pipeline #34977 failed
......@@ -13,6 +13,7 @@ variables:
ANSIBLE_DIFF_ALWAYS: "1"
ANSIBLE_DISPLAY_SKIPPED_HOSTS: "0"
ANSIBLE_FORCE_COLOR: "1"
ANSIBLE_INJECT_FACT_VARS: "0"
ANSIBLE_REMOTE_TMP: "/tmp"
ANSIBLE_SHELL_ALLOW_WORLD_READABLE_TEMP: "1"
DEBIAN_FRONTEND: noninteractive
......
......@@ -35,7 +35,7 @@ repos:
- VARIABLES.md
# https://github.com/ansible/ansible-lint/releases
- repo: https://github.com/ansible/ansible-lint.git
rev: v24.9.0
rev: v24.9.2
hooks:
- id: ansible-lint
name: Ansible Lint
......
......@@ -18,17 +18,17 @@
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: Debug ansible_effective_user_id
- name: Debug ansible_facts.effective_user_id
ansible.builtin.debug:
var: ansible_effective_user_id
var: ansible_facts.effective_user_id
- name: Debug ansible_user_id
- name: Debug ansible_facts.user_id
ansible.builtin.debug:
var: ansible_user_id
var: ansible_facts.user_id
- name: Debug ansible_user_dir
- name: Debug ansible_facts.user_dir
ansible.builtin.debug:
var: ansible_user_dir
var: ansible_facts.user_dir
- name: Include php role as root
ansible.builtin.include_role:
......
......@@ -18,17 +18,17 @@
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: Debug ansible_effective_user_id
- name: Debug ansible_facts.effective_user_id
ansible.builtin.debug:
var: ansible_effective_user_id
var: ansible_facts.effective_user_id
- name: Debug ansible_user_id
- name: Debug ansible_facts.user_id
ansible.builtin.debug:
var: ansible_user_id
var: ansible_facts.user_id
- name: Debug ansible_user_dir
- name: Debug ansible_facts.user_dir
ansible.builtin.debug:
var: ansible_user_dir
var: ansible_facts.user_dir
- name: Include php role as root
ansible.builtin.include_role:
......
......@@ -18,17 +18,17 @@
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: Debug ansible_effective_user_id
- name: Debug ansible_facts.effective_user_id
ansible.builtin.debug:
var: ansible_effective_user_id
var: ansible_facts.effective_user_id
- name: Debug ansible_user_id
- name: Debug ansible_facts.user_id
ansible.builtin.debug:
var: ansible_user_id
var: ansible_facts.user_id
- name: Debug ansible_user_dir
- name: Debug ansible_facts.user_dir
ansible.builtin.debug:
var: ansible_user_dir
var: ansible_facts.user_dir
- name: Include php role as root
ansible.builtin.include_role:
......
......@@ -71,7 +71,7 @@
name: php
pdiffs: true
signed_by: /usr/share/keyrings/deb.sury.org-php.gpg
suites: "{{ ansible_distribution_release }}"
suites: "{{ ansible_facts.distribution_release }}"
types: deb
uris: https://packages.sury.org/php/
check_mode: true
......@@ -93,7 +93,7 @@
creates: "/etc/apt/sources.list.d/.php.sources.{{ php_date_timestamp }}.ansible.save"
removes: /etc/apt/sources.list.d/php.sources
vars:
php_date_timestamp: "{{ ansible_date_time.iso8601_basic_short }}"
php_date_timestamp: "{{ ansible_facts.date_time.iso8601_basic_short }}"
when: php_sources_contents_prior != php_sources_check.repo | string | community.general.jc('ini')
when: php_sources_path.stat.exists | bool
......@@ -111,7 +111,7 @@
name: php
pdiffs: true
signed_by: /usr/share/keyrings/deb.sury.org-php.gpg
suites: "{{ ansible_distribution_release }}"
suites: "{{ ansible_facts.distribution_release }}"
types: deb
uris: https://packages.sury.org/php/
register: php_sources
......
......@@ -99,10 +99,10 @@
- name: Check that the distro is Debian Bookworm, Bullseye or Buster
ansible.builtin.assert:
that:
- ansible_distribution_release is defined
- ansible_distribution_release is regex("^bullseye|bookworm|buster$")
- ansible_facts.distribution_release is defined
- ansible_facts.distribution_release is regex("^bullseye|bookworm|buster$")
quiet: "{% if ansible_verbosity == 0 %}true{% else %}false{% endif %}"
fail_msg: "The Linux distro {{ ansible_distribution }} {{ ansible_distribution_release }} is not supported by this role"
fail_msg: "The Linux distro {{ ansible_facts.distribution }} {{ ansible_facts.distribution_release }} is not supported by this role"
- name: Debug PHP versions and config due to be present and absent
ansible.builtin.debug:
......
......@@ -31,7 +31,7 @@
removes: "{{ php_file_absent }}"
creates: "{{ php_file_backup }}"
vars:
php_file_backup: "{{ php_file_absent | ansible.builtin.dirname }}/.{{ php_file_absent | ansible.builtin.basename }}.{{ ansible_date_time.iso8601_basic_short }}.ansible.save"
php_file_backup: "{{ php_file_absent | ansible.builtin.dirname }}/.{{ php_file_absent | ansible.builtin.basename }}.{{ ansible_facts.date_time.iso8601_basic_short }}.ansible.save"
register: php_file_path_absent
when: php_file_absent_path.stat.exists | bool
......
......@@ -144,7 +144,7 @@
- name: Set facts for the PHP configuration file
ansible.builtin.set_fact:
php_conf_file_backup: "{{ php_conf_file | ansible.builtin.dirname }}/.{{ php_conf_file | ansible.builtin.basename }}.{{ ansible_date_time.iso8601_basic_short }}.bak"
php_conf_file_backup: "{{ php_conf_file | ansible.builtin.dirname }}/.{{ php_conf_file | ansible.builtin.basename }}.{{ ansible_facts.date_time.iso8601_basic_short }}.bak"
php_conf_file_changed: false
php_conf_file_sapi: null
php_conf_file_version: "{{ php_conf_file | ansible.builtin.split(php_file_path_separator) | community.general.json_query('[3]') }}"
......
......@@ -13,7 +13,7 @@
- name: Set facts for the PHP configuration file
ansible.builtin.set_fact:
php_conf_file_backup: "{{ php_conf_file | ansible.builtin.dirname }}/.{{ php_conf_file | ansible.builtin.basename }}.{{ ansible_date_time.iso8601_basic_short }}.bak"
php_conf_file_backup: "{{ php_conf_file | ansible.builtin.dirname }}/.{{ php_conf_file | ansible.builtin.basename }}.{{ ansible_facts.date_time.iso8601_basic_short }}.bak"
php_conf_file_no_extra_spaces: "{%- if (php_conf_file | ansible.builtin.dirname | ansible.builtin.split('/') | last) == 'mods-available' -%}true{%- else -%}false{%- endif -%}"
php_conf_file_proposed_vars: "{{ php_config | community.general.json_query(php_conf_file_proposed_vars_json_query) }}"
php_conf_file_sapi: null
......
......@@ -164,7 +164,7 @@
- name: Apt clean
ansible.builtin.include_tasks: apt_clean.yml
when: >-
( ansible_version.full is version('2.13', '>=') ) and
( ansible_facts.version.full is version('2.13', '>=') ) and
( ( ( php_packages_installed.changed is defined ) and ( php_packages_installed.changed | bool ) ) or
( ( php_packages_removed_first_run.changed is defined ) and ( php_packages_removed_first_run.changed | bool ) ) or
( ( php_packages_removed_second_run.changed is defined ) and ( php_packages_removed_second_run.changed | bool ) ) )
......
# {{ ansible_managed }}
{% if ansible_distribution_release == "bookworm" %}
{% if ansible_facts.distribution_release == "bookworm" %}
{% for pkg in php_debian_bookworm_pkg %}
Package: {{ pkg }}
Pin: origin packages.sury.org
Pin-Priority: 500
{% endfor %}
{% elif ansible_distribution_release == "bullseye" %}
{% elif ansible_facts.distribution_release == "bullseye" %}
{% for pkg in php_debian_bullseye_pkg %}
Package: {{ pkg }}
Pin: origin packages.sury.org
Pin-Priority: 500
{% endfor %}
{% elif ansible_distribution_release == "buster" %}
{% elif ansible_facts.distribution_release == "buster" %}
{% for pkg in php_debian_buster_pkg %}
Package: {{ pkg }}
Pin: origin packages.sury.org
......
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