Skip to content

Instantly share code, notes, and snippets.

@sorquan
Last active March 9, 2021 19:09
Show Gist options
  • Save sorquan/2e67111108f242b041b1309d4146da34 to your computer and use it in GitHub Desktop.
Save sorquan/2e67111108f242b041b1309d4146da34 to your computer and use it in GitHub Desktop.
Some ansible playbooks
---
- 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