diff --git a/software/install-ansible/README.md b/software/install-ansible/README.md index d5f7242..c35647d 100644 --- a/software/install-ansible/README.md +++ b/software/install-ansible/README.md @@ -13,3 +13,7 @@ Additionally it is possible to request a specific version other than the latest/ - `data:install_ansible.version` - if this variable is defined then a specific version will be installed Note that the system in question must have a `pipx` package available through the default package manager as well as python installed which should come along as a dependency of `pipx`. + +On Red Hat based systems, Ansible is installed with `dnf` instead of `pipx`. +The minimal install uses the `ansible-core` package from the default repositories. +The full install uses the `ansible` package, which requires the EPEL repository to be enabled. diff --git a/software/install-ansible/install-ansible.cf b/software/install-ansible/install-ansible.cf index b705fb6..04ac1c6 100644 --- a/software/install-ansible/install-ansible.cf +++ b/software/install-ansible/install-ansible.cf @@ -36,16 +36,27 @@ bundle agent install_ansible_main if => not(isvariable("data:install_ansible.version")); data:ansible_minimal_install:: + "package" string => "ansible-core"; "base_command" string => "pipx install --global ansible-core"; data:ansible_full_install|(!data:ansible_full_install.!data:ansible_minimal_install):: + "package" string => "ansible"; "base_command" string => "pipx install --global --include-deps ansible"; packages: - "pipx" classes => if_ok("pipx_installed"); + # Use the distro packages on Red Hat, as recommended by Ansible + redhat:: + "${package}" + version => "${data:install_ansible.version}", + if => isvariable("data:install_ansible.version"); + + "${package}" if => not(isvariable("data:install_ansible.version")); + + !redhat:: + "pipx" classes => if_ok("pipx_installed"); commands: - pipx_installed.!ansible_installed:: + !redhat.pipx_installed.!ansible_installed:: "${install_ansible_command}" contain => in_shell_umask(022), comment => "The default umask of 077 would create /opt/pipx/venvs/ansible which is inaccessible to everyone but root, so use 022 instead.";