From 3b2bf92e1cdd2bbda0d5941f97ca9133f3e6cc83 Mon Sep 17 00:00:00 2001 From: Viktor Berke Date: Fri, 8 Nov 2024 22:26:25 +0100 Subject: [PATCH] OS updates --- .github/workflows/{fedora-38.yml => fedora-40.yml} | 4 ++-- .github/workflows/{fedora-39.yml => fedora-41.yml} | 4 ++-- .../workflows/{ubuntu-18.04.yml => ubuntu-24.04.yml} | 4 ++-- tasks/host.yml | 2 +- tasks/main2.yml | 2 +- tasks/php.yml | 10 +++++----- tasks/wordpress.yml | 6 +++--- vars/main.yml | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) rename .github/workflows/{fedora-38.yml => fedora-40.yml} (93%) rename .github/workflows/{fedora-39.yml => fedora-41.yml} (93%) rename .github/workflows/{ubuntu-18.04.yml => ubuntu-24.04.yml} (93%) diff --git a/.github/workflows/fedora-38.yml b/.github/workflows/fedora-40.yml similarity index 93% rename from .github/workflows/fedora-38.yml rename to .github/workflows/fedora-40.yml index 1c250c7..c6c6472 100644 --- a/.github/workflows/fedora-38.yml +++ b/.github/workflows/fedora-40.yml @@ -1,5 +1,5 @@ --- -name: Fedora 38 +name: Fedora 40 on: # yamllint disable-line rule:truthy push: @@ -18,7 +18,7 @@ jobs: - name: Test Galaxy role run: > CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro - --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-fedora:38) && + --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-fedora:40) && podman exec ${CONT_ID} /bin/bash -c "if [ -f requirements.yml ]; then ansible-galaxy role install --force -r requirements.yml -p ..; fi && ANSIBLE_ROLES_PATH=.. ANSIBLE_FORCE_COLOR=true ansible-playbook tests/main.yml" && diff --git a/.github/workflows/fedora-39.yml b/.github/workflows/fedora-41.yml similarity index 93% rename from .github/workflows/fedora-39.yml rename to .github/workflows/fedora-41.yml index db9ace4..436006a 100644 --- a/.github/workflows/fedora-39.yml +++ b/.github/workflows/fedora-41.yml @@ -1,5 +1,5 @@ --- -name: Fedora 39 +name: Fedora 41 on: # yamllint disable-line rule:truthy push: @@ -18,7 +18,7 @@ jobs: - name: Test Galaxy role run: > CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro - --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-fedora:39) && + --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-fedora:41) && podman exec ${CONT_ID} /bin/bash -c "if [ -f requirements.yml ]; then ansible-galaxy role install --force -r requirements.yml -p ..; fi && ANSIBLE_ROLES_PATH=.. ANSIBLE_FORCE_COLOR=true ansible-playbook tests/main.yml" && diff --git a/.github/workflows/ubuntu-18.04.yml b/.github/workflows/ubuntu-24.04.yml similarity index 93% rename from .github/workflows/ubuntu-18.04.yml rename to .github/workflows/ubuntu-24.04.yml index ae7454a..a146885 100644 --- a/.github/workflows/ubuntu-18.04.yml +++ b/.github/workflows/ubuntu-24.04.yml @@ -1,5 +1,5 @@ --- -name: Ubuntu 18.04 +name: Ubuntu 24.04 on: # yamllint disable-line rule:truthy push: @@ -18,7 +18,7 @@ jobs: - name: Test Galaxy role run: > CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro - --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-ubuntu:18.04) && + --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-ubuntu:24.04) && podman exec ${CONT_ID} /bin/bash -c "if [ -f requirements.yml ]; then ansible-galaxy role install --force -r requirements.yml -p ..; fi && ANSIBLE_ROLES_PATH=.. ANSIBLE_FORCE_COLOR=true ansible-playbook tests/main.yml" && diff --git a/tasks/host.yml b/tasks/host.yml index bac2caa..81f2623 100644 --- a/tasks/host.yml +++ b/tasks/host.yml @@ -10,7 +10,7 @@ notify: Reload nginx - include_tasks: selinux.yml - when: ansible_pkg_mgr == 'dnf' + when: ansible_os_family == 'RedHat' - name: "Enable {{ domain }} host" file: diff --git a/tasks/main2.yml b/tasks/main2.yml index 7737426..12b6273 100644 --- a/tasks/main2.yml +++ b/tasks/main2.yml @@ -1,6 +1,6 @@ --- - include_tasks: apt_cache.yml - when: ansible_pkg_mgr == 'apt' and noobient_apt_cache_updated is not defined + when: ansible_os_family == 'Debian' and noobient_apt_cache_updated is not defined - include_tasks: wordpress.yml when: (noobient_nginx_wp_installed is not defined) and (mode == 'wordpress') diff --git a/tasks/php.yml b/tasks/php.yml index b2739d2..598f1f5 100644 --- a/tasks/php.yml +++ b/tasks/php.yml @@ -10,17 +10,17 @@ cmd: "update-alternatives --query php | grep '^Best' | awk '{print $2}' | xargs basename | sed 's/php//'" changed_when: false register: noobient_nginx_php_check - when: ansible_pkg_mgr == 'apt' + when: ansible_os_family == 'Debian' - set_fact: noobient_nginx_php_ver: "{{ noobient_nginx_php_check.stdout_lines[0] }}" when: ansible_pkg_mgr == 'apt' - set_fact: - noobient_nginx_php_unit: "php{% if ansible_pkg_mgr == 'apt' %}{{ noobient_nginx_php_ver }}{% endif %}-fpm.service" - noobient_nginx_php_ini: "{% if ansible_pkg_mgr == 'dnf' %}/etc/php.ini{% else %}/etc/php/{{ noobient_nginx_php_ver }}/fpm/php.ini{% endif %}" - noobient_nginx_fpm_conf: "{% if ansible_pkg_mgr == 'dnf' %}/etc/php-fpm.d/{% else %}/etc/php/{{ noobient_nginx_php_ver }}/fpm/pool.d/{% endif %}www.conf" - noobient_nginx_fpm_sock: "{% if ansible_pkg_mgr == 'dnf' %}{{ default_fpm_sock }}{% else %}/run/php/php{{ noobient_nginx_php_ver }}-fpm.sock{% endif %}" + noobient_nginx_php_unit: "php{% if ansible_os_family == 'Debian' %}{{ noobient_nginx_php_ver }}{% endif %}-fpm.service" + noobient_nginx_php_ini: "{% if ansible_os_family == 'RedHat' %}/etc/php.ini{% else %}/etc/php/{{ noobient_nginx_php_ver }}/fpm/php.ini{% endif %}" + noobient_nginx_fpm_conf: "{% if ansible_os_family == 'RedHat' %}/etc/php-fpm.d/{% else %}/etc/php/{{ noobient_nginx_php_ver }}/fpm/pool.d/{% endif %}www.conf" + noobient_nginx_fpm_sock: "{% if ansible_os_family == 'RedHat' %}{{ default_fpm_sock }}{% else %}/run/php/php{{ noobient_nginx_php_ver }}-fpm.sock{% endif %}" - name: Set PHP options ini_file: diff --git a/tasks/wordpress.yml b/tasks/wordpress.yml index d467c7f..a4d9da4 100644 --- a/tasks/wordpress.yml +++ b/tasks/wordpress.yml @@ -12,13 +12,13 @@ - php-json - php-mbstring - php-xml - - "php{% if ansible_pkg_mgr == 'apt' %}{{ noobient_nginx_php_ver }}{% endif %}-intl" - - "php{% if ansible_pkg_mgr == 'dnf' %}-pecl{% else %}{{ noobient_nginx_php_ver }}{% endif %}-zip" + - "php{% if ansible_os_family == 'Debian' %}{{ noobient_nginx_php_ver }}{% endif %}-intl" + - "php{% if ansible_os_family == 'RedHat' %}-pecl{% else %}{{ noobient_nginx_php_ver }}{% endif %}-zip" register: noobient_nginx_wp_installed # Not available on EL8 - name: Install ImageMagick PHP extension package: - name: "php{% if ansible_pkg_mgr == 'dnf' %}-pecl{% else %}{{ noobient_nginx_php_ver }}{% endif %}-imagick" + name: "php{% if ansible_os_family == 'RedHat' %}-pecl{% else %}{{ noobient_nginx_php_ver }}{% endif %}-imagick" state: latest when: not (ansible_distribution_major_version == '8' and ansible_os_family == 'RedHat') diff --git a/vars/main.yml b/vars/main.yml index 319f773..dbe199c 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,6 @@ --- nginx_root: /etc/nginx -nginx_account: "{% if ansible_pkg_mgr == 'dnf' %}nginx{% else %}www-data{% endif %}" +nginx_account: "{% if ansible_os_family == 'RedHat' %}nginx{% else %}www-data{% endif %}" eff_path: "{% if path is defined and path | length %}{{ path }}{% else %}/var/www/html/{{ domain }}{% endif %}" eff_www_mode: "{% if www_mode is defined and www_mode | length %}{{ www_mode }}{% else %}redirect{% endif %}"