31 lines
678 B
YAML
31 lines
678 B
YAML
|
---
|
||
|
- name: Deploy updated web pages
|
||
|
hosts: web
|
||
|
become: yes
|
||
|
tasks:
|
||
|
- name: remove directory
|
||
|
file:
|
||
|
path: /var/www/html
|
||
|
state: absent
|
||
|
|
||
|
- name: Pull the latest changes from the repository
|
||
|
git:
|
||
|
repo: 'http://aws-handson-gitea.com:3000/hands-on/webpage.git'
|
||
|
dest: '/var/www/html'
|
||
|
version: 'HEAD'
|
||
|
when: ansible_check_mode == false
|
||
|
|
||
|
- name: Set correct permissions
|
||
|
file:
|
||
|
path: '/var/www/html'
|
||
|
state: directory
|
||
|
owner: apache
|
||
|
group: apache
|
||
|
mode: '0755'
|
||
|
|
||
|
- name: httpd restart
|
||
|
service:
|
||
|
name: httpd
|
||
|
state: restarted
|
||
|
enabled: yes
|