forked from ravi2krishna/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
26-tags.yml
34 lines (29 loc) · 782 Bytes
/
26-tags.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
# yum and service modules with sudo access
# Now i don't want the task configure port 8081 and restarting service to run
---
- hosts: web
become: yes
tasks:
# This task will install apache http server
- name: Install Apache
yum:
name: httpd
state: present
tags: install
# This task will start apache http server
- name: Start Apache
service:
name: httpd
state: started
enabled: yes
tags: start
# This task will copy custom httpd.conf file to /etc/httpd/conf/httpd.conf
- name: Copy apache config with port 8081 defined
copy:
src: 12/httpd.conf
dest: /etc/httpd/conf/httpd.conf
# This task will restart apache http server
- name: Restart Apache
service:
name: httpd
state: restarted