Last active
March 9, 2021 19:09
-
-
Save sorquan/2e67111108f242b041b1309d4146da34 to your computer and use it in GitHub Desktop.
Some ansible playbooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install Web | |
hosts: hostgroup | |
become: true | |
vars: | |
- repo: | |
Debian: | |
- apt | |
RedHat: | |
- epel-release | |
- packages: | |
Debian: | |
- nginx | |
- php-fpm | |
RedHat: | |
- httpd | |
- php-fpm | |
- services: | |
Debian: apache2 | |
RedHat: httpd | |
tasks: | |
- name: Install repo | |
package: | |
name: "{{ repo[ansible_os_family] }}" | |
- name: Install Web Server Packages | |
package: | |
name: "{{ packages[ansible_os_family] }}" | |
state: latest | |
- name: Web Service Start | |
service: | |
name: "{{ services[ansible_os_family] }}" | |
state: restarted | |
enabled: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment