Created
September 28, 2017 15:15
-
-
Save joshuabalduff/8b565ed18842d1b85c3bb12671183055 to your computer and use it in GitHub Desktop.
Lamp Ansible Playbook
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
--- | |
- hosts: all | |
gather_facts: false | |
connection: local | |
become: yes | |
vars: | |
packages: | |
- apache2 | |
- mysql-server | |
- mysql-common | |
- mysql-client | |
services: | |
- apache2 | |
- mysql | |
tasks: | |
- name: Install our packages | |
apt: | |
name: "{{ item }}" | |
state: present | |
with_items: "{{ packages }}" | |
- name: Confirm services are running | |
service: | |
name: "{{ item }}" | |
state: running | |
with_items: "{{ services }}" | |
- name: Enable Apache2 modssl | |
shell: a2enmod ssl | |
- name: Enable Apache2 Default HTTPS site | |
shell: a2ensite default-ssl | |
- name: Restart Apache | |
service: | |
name: apache2 | |
state: restarted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment