install apache2 on ubuntu & httpd on centos
---
- name: Install apache
hosts: all
gather_facts: yes
tasks:
- name: install apache on ubuntu
package:
name: apache2
state: present
when: ansible_distribution == "Ubuntu"
- name: install httpd on centos
package:
name: httpd
state: present
when: ansible_distribution == "CentOS"
Comments
Post a Comment