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
7 changes: 6 additions & 1 deletion ch1-lab-setup/sample/hosts.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
[linux]
192.168.100.21
172.16.44.103
172.16.44.231
172.16.44.172
#192.168.1.7
#192.168.1.17
#192.168.1.31
9 changes: 7 additions & 2 deletions ch2-inventory/inventory/01-ipOnly.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<<<<<<< HEAD
192.168.1.17

192.168.1.43
=======
192.168.100.12
>>>>>>> 19d7f43fd7619a5c19e29da439623a8e2c21b3df

192.168.100.21
192.168.1.239

192.168.100.22
12 changes: 12 additions & 0 deletions ch2-inventory/student-nctin/02-nonFQDN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
all:
hosts:
ubuntu01:
ansible_host: 192.168.1.109
centos01:
ansible_host: 192.168.1.17
centos02:
ansible_host: 192.168.1.43
centos03:
ansible_host: 192.168.1.239


19 changes: 19 additions & 0 deletions ch2-inventory/student-nctin/03-hostgroups-children.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
all:
hosts:
fakehost.local:
children:
linux:
children:
ubuntu:
hosts:
ubuntu:
ansible_host: 192.168.1.109
centos:
hosts:
centos1:
ansible_host: 192.168.1.17
centos2:
ansible_host: 192.168.1.43
centos3:
ansible_host: 192.168.1.239

18 changes: 14 additions & 4 deletions ch3-playbook/07-install-apache-not-work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
- name: The demo playbook
hosts: all
gather_facts: yes

vars:
- my_name: tinnc
- web_server:
Debian: apache2
RedHat: httpd
tasks:
- name: Install Apache package
yum:
name: httpd
name: "{{ web_server[ansible_os_family] }}"
state: latest

- name: index Hello!
template:
src: "files/index.html"
dest: "/var/www/html/"
mode: 0755

- name: Restart and enable the service
service:
name: httpd
name: "{{ web_server[ansible_os_family] }}"
state: restarted
enabled: yes
enabled: yes
8 changes: 8 additions & 0 deletions ch3-playbook/files/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<title>Hello {{ my_name }} !</title>
</head>
<body>
<h1>Hello! {{ my_name }}!</h1>
</body>
</html>
6 changes: 4 additions & 2 deletions ch3-playbook/inventory/group_vars/all.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
ansible_user: ansible
ansible_password: admin123 #will be moved into Ansible Vault for more secure
#ansible_user: ansible
#ansible_password: admin123 #will be moved into Ansible Vault for more secure
ansible_become: yes
ansible_become_method: sudo