Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ch2-inventory/student-quanpt/01-ipOnly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
all:
hosts:
192.168.100.11:
192.168.100.12:
192.168.100.21:
192.168.100.22:
10 changes: 10 additions & 0 deletions ch2-inventory/student-quanpt/02-nonFQDN.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all:
hosts:
ubuntu11:
ansible_host: 192.168.100.11
ubuntu12:
ansible_host: 192.168.100.12
centos21:
ansible_host: 192.168.100.21
centos22:
ansible_host: 192.168.100.22
15 changes: 15 additions & 0 deletions ch2-inventory/student-quanpt/03-hostgroups-children-copy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
fakehost.local:
linux:
children:
ubuntu:
hosts:
ubuntu11:
ansible_host: 192.168.100.11
ubuntu12:
ansible_host: 192.168.100.12
centos:
hosts:
centos21:
ansible_host: 192.168.100.21
centos22:
ansible_host: 192.168.100.22
23 changes: 23 additions & 0 deletions ch3-playbook/08-quanpt-apache-helloworld.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Playbook for automated apache installation
---
- name: The demo playbook
hosts: all
gather_facts: yes
become: yes

tasks:
- name: Install Apache package
apt:
name: apache2
state: latest

- name: Copy index.html
copy:
src: index.html
dest: /var/www/html/
mode: 0755
- name: Restart and enable the service
systemd:
name: apache2
state: restarted
enabled: yes
23 changes: 23 additions & 0 deletions ch3-playbook/08-quanpt-apache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Playbook for automated apache installation
---
- name: The demo playbook
hosts: all
gather_facts: yes
become: yes

tasks:
- name: Install Apache package
apt:
name: apache2
state: latest

- name: Copy index.html
copy:
src: index.html
dest: /var/www/html/
mode: 0755
- name: Restart and enable the service
systemd:
name: apache2
state: restarted
enabled: yes
1 change: 1 addition & 0 deletions ch3-playbook/files/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello QuanPT
16 changes: 8 additions & 8 deletions ch3-playbook/inventory/hosts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[ubuntu]
ubuntu11 ansible_host=192.168.100.11
ubuntu12 ansible_host=192.168.100.12
ubuntu-2 ansible_host=192.168.94.242
ubuntu-3 ansible_host=192.168.94.243

[centos]
centos21 ansible_host=192.168.100.21
centos22 ansible_host=192.168.100.22
#[centos]
#centos21 ansible_host=192.168.100.21
#centos22 ansible_host=192.168.100.22


[linux:children]
ubuntu
centos
#[linux:children]
#ubuntu
#centos