-
Notifications
You must be signed in to change notification settings - Fork 6
/
deploy-app-dev.yml
43 lines (39 loc) · 1.31 KB
/
deploy-app-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
# This playbook adds a user, and expects to be passed a username variable on the ansible-playbook command line
- hosts: web
become_user: root
become_method: sudo
become: yes
tasks:
- name: Install web server
yum: state=present name={{ item }}
tags: software
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
with_items:
- httpd
- git
- firewalld
- name: Deploy web application
git:
repo: 'https://github.com/aludwar/webapp.git'
dest: /var/www/html/webapp
#version: release-0.22
- name: Start/enable web server and firewalld
systemd:
name: "{{ item }}"
state: started
enabled: yes
with_items:
- 'httpd'
- 'firewalld'
tags: software
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
- name: Set firewall rules to allow http/https
firewalld:
service: "{{ item }}"
permanent: true
state: enabled
immediate: yes
with_items:
- https
- http