I want to install the following packages on Red Hat managed nodes:
* httpd
* httpd-devel
* httpd-tools
What would my playbook entry look like to achieve this?
This playbook install the required packages only.
If you want to use the http service, you should not forget to enable the httpd service and allow http traffic in the firewall.
enable http service:
- name: Enable and start httpd service
service:
name: httpd
state: started
enabled: yes
- name: allow http service in firewalld
firewalld:
service: http
permanent: yes
state: enabled
immediate: yes
when: ansible_facts.service["firewalld.service"] is defined
There may be a typo. I recommended checking the help documentation against possible syntax error.
example: $ ansible-navigator doc ansible.builtin.yum
@Trevor your friend here is dnf / yum module. You can apply a list of packages to the module for the job :
tasks: - name: Install httpd and other packages dnf: name: - httpd - httpd-devel - httpd-tools state: present
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.