Skip to content

Commit 13823de

Browse files
committed
Working Hard :-) Deathline coming!
1 parent 7c969e6 commit 13823de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+349
-35
lines changed

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"options": {
44
"env": {
55
/* Public FQDN to the Ansible Controller Host*/
6-
"ANSIBLEHOST": "ec2-18-196-201-89.eu-central-1.compute.amazonaws.com",
6+
"ANSIBLEHOST": "ec2-18-185-98-43.eu-central-1.compute.amazonaws.com",
77
/* Path to Win SCP Executable*/
88
"WINSCPEXE": "C:\\Program Files (x86)\\WinSCP\\WinSCP.com",
99

TODO.md

+40
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,50 @@
1+
- genug gehipped nach einführung
2+
3+
- Hinzufügen was mir noch einfällt was ich erzählen will per folie
4+
5+
- Änderungen bei Ansible 2.9, alles mit Ansible 2.9 testen
6+
- auf Starwars Ändern, Matrix kennt keiner...!!!
7+
- https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#shell-completion
8+
9+
10+
- loop , da dies nun die default sache ist
11+
https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#standard-loops
12+
13+
- Demo Übung 4
14+
15+
- Ansible Vault
16+
17+
- Yaml Basics
18+
19+
- Best Practice
20+
http://ansible.github.io/lightbulb/decks/ansible-best-practices.html#/2
21+
22+
- Scaling / Rest API
23+
- Ansible for Network Devices
24+
- Slogang
25+
26+
- Ausdrucken der Speak notes
27+
- Ausdrucken der Folien
28+
29+
- Ansible Cheat sheet hergeben
30+
- eines schreiben?
31+
32+
https://linuxacademy.com/site-content/uploads/2019/05/Linux-Academy-Ansible-Roles-Cheatsheet.pdf
33+
34+
- Bonus task? HA Proxy auf ctrl ec2 instance
35+
36+
137
- Implement ARA on ansible vm
238
- Do the slides
339
- Writeout help desk for slides
440
- write up handout
541
- Test lenght
642
- build docs with sphinx, da wir kein PDF Export haben?
743

44+
45+
46+
847
Coole memes
948

1049
https://www.imagenesmy.com/imagenes/configuration-management-meme-a3.html
50+

demos/2-basic-playbook/inventory.ini

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ debian2
1919
[linux:vars]
2020
ansible_user=admin
2121
ansible_port=22
22+
ansible_become=yes
2223
ansible_ssh_private_key_file="~/.ssh/workshop.key"
2324
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
2425

demos/2-basic-playbook/simple.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
- name: We make us some Webservers
44
hosts: web
5-
become: yes
65
tasks:
76
- name: nginx package is present
87
apt:

demos/3-advanced-playbook/advanced.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
- name: We make us some Webservers
44
hosts: web
5-
become: yes
65
tasks:
76
- name: nginx package is present
87
apt:

demos/3-advanced-playbook/inventory.ini

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ debian2
1919
[linux:vars]
2020
ansible_user=admin
2121
ansible_port=22
22+
ansible_become=yes
2223
ansible_ssh_private_key_file="~/.ssh/workshop.key"
2324
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
2425

demos/4-roles/demo4.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- name: We make us some Webservers
3+
hosts: web,win1
4+
tasks:
5+
- import_role: name=myapp
6+
vars:
7+
config: "{{ app_config }}"

demos/4-roles/host_vars/debian1.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
app_config:
2+
pill: blue
3+
image: bluepill.png

demos/4-roles/host_vars/debian2.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
app_config:
2+
pill: red
3+
image: redpill.png

demos/4-roles/host_vars/win1.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
app_config:
2+
pill: Windows
3+
image: windows.png

demos/4-roles/inventory.ini

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
ctrl ansible_host=10.0.1.10
2+
debian1 ansible_host=10.0.1.21
3+
debian2 ansible_host=10.0.1.22
4+
win1 ansible_host=10.0.1.41
5+
6+
[windows]
7+
win1
8+
9+
[linux]
10+
ctrl
11+
debian1
12+
debian2
13+
14+
# Added this
15+
[web]
16+
debian1
17+
debian2
18+
19+
[linux:vars]
20+
ansible_become=yes
21+
ansible_user=admin
22+
ansible_port=22
23+
ansible_ssh_private_key_file="~/.ssh/workshop.key"
24+
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
25+
26+
[windows:vars]
27+
ansible_connection=winrm
28+
ansible_user="Administrator"
29+
ansible_password="ansible#workshop1"
30+
ansible_winrm_transport=basic
31+
ansible_winrm_server_cert_validation=ignore
32+
ansible_port=5986
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
config:
2+
pill: blue
3+
image: bluepill.png
4+
5+
iis_default_root: "c:/inetpub/wwwroot"
19 KB
Loading
37.8 KB
Loading
242 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: restart_nginx
2+
service:
3+
name: nginx.service
4+
state: restarted
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- name: nginx package is present
2+
apt:
3+
name: nginx
4+
state: latest
5+
notify: restart_nginx
6+
7+
- name: deploy our awesome app - index.html
8+
template:
9+
src: index.html
10+
dest: /var/www/html/index.html
11+
12+
- name: deploy our awesome app - image.jpg
13+
copy:
14+
src: "{{ app_config.image }}"
15+
dest: "/var/www/html/{{ app_config.image }}"
16+
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- include_tasks: debian.yml
2+
when: "ansible_os_family == 'Debian'"
3+
4+
- include_tasks: windows.yml
5+
when: "ansible_os_family == 'Windows'"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- name: "windows: ensure iis role is installed"
2+
win_feature:
3+
name: Web-Server
4+
5+
- name: "windows: ensure index.html is present as default.htm"
6+
win_template:
7+
src: "index.html"
8+
dest: "{{ iis_default_root }}/default.htm"
9+
10+
- name: "windows: ensure image.png exists in webroot"
11+
win_copy:
12+
src: "{{ config.image }}"
13+
dest: "{{ iis_default_root }}/{{ config.image }}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>Ansible Configured Host</title>
4+
</head>
5+
<body>
6+
<h2>Here you have a {{ config.pill }} pill!</h2>
7+
<img src="{{ config.image }}"/>
8+
</body>
9+
</html>

environment/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
gather_facts: false
4444
become: yes
4545
vars:
46-
ansible_branch: v2.7.6
46+
ansible_branch: stable-2.9
4747
tasks:
4848
- name: "Configure required apt packages"
4949
apt:

environment/env_config.yml

+16-12
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,36 @@ workshop_configuration:
2525

2626
instances:
2727
- name: 'ctrl'
28-
ami_id: 'ami-0ca467408e84df23c'
28+
29+
# Debian Buster
30+
ami_id: 'ami-01eb7b0c1119f2550'
2931
instance_type: 't2.medium'
3032
subnet_ip: '10'
3133
usage: 'ansible'
3234
os: 'linux'
3335

3436
- name: 'debian1'
35-
ami_id: 'ami-0ca467408e84df23c'
36-
instance_type: 't2.micro'
37+
ami_id: 'ami-01eb7b0c1119f2550'
38+
instance_type: 't2.small'
3739
subnet_ip: '21'
3840
usage: 'managed_host'
3941
os: 'linux'
4042

4143
- name: 'debian2'
42-
ami_id: 'ami-0ca467408e84df23c'
43-
instance_type: 't2.micro'
44+
ami_id: 'ami-01eb7b0c1119f2550'
45+
instance_type: 't2.small'
4446
subnet_ip: '22'
4547
usage: 'managed_host'
4648
os: 'linux'
4749

48-
# - name: 'win1'
49-
# ami_id: 'ami-023361bb7fb02858c'
50-
# instance_type: 't2.medium'
51-
# subnet_ip: '41'
52-
# usage: 'managed_host'
53-
# os: 'windows'
54-
# user_data: "{{ lookup('template', 'assets/win_ami_userdata.txt.j2') }}"
50+
- name: 'win1'
51+
52+
# Server 2019 Core - 2019.12.16
53+
ami_id: 'ami-0993115ae39c29486'
54+
instance_type: 't2.medium'
55+
subnet_ip: '41'
56+
usage: 'managed_host'
57+
os: 'windows'
58+
user_data: "{{ lookup('template', 'assets/win_ami_userdata.txt.j2') }}"
5559

5660

slides/content/0_prelude/2_environment.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h2>Ansible Controller (ctrl)</h2>
6363
<b>VPC IP:</b> 10.0.<i>X</i>.<b>10</b> / 16
6464
</p>
6565
<p>
66-
<h2>Windows 2016 Host (win1)</h2>
66+
<h2>Windows 2019 Core Host (win1)</h2>
6767
<b>VPC IP:</b> 10.0.<i>X</i>.<b>41</b> / 16
6868
</p>
6969
</div>

slides/content/1_overview/1_was_ist_ansible.html

+14-4
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,31 @@ <h1>[Imagination]Ops Tool</h1>
9999
notes:
100100
- von oben nach unten im gegensatz zu salt/chef (merged classes/structures)
101101
</section>
102+
<section>
103+
<div class="columns">
104+
<div class="col">
105+
<img src="images/super_ansible.jpg" style="height: 800px; text-align: center"/>
106+
</div>
107+
<div class="col">
108+
<img src="images/ansible-all-of-the-things.jpg" style="height: 800px; text-align: center">
109+
</div>
110+
</div>
111+
</section>
102112
<section>
103113
<h1>Anforderungen</h1>
104114
<h2>Controller</h2>
105115
<ul>
106116
<li>Linux/Unix Based OS</li>
107117
<li><b>Windows (WSL) unsupported, aber funktioniert</b></li>
108118
<li>CygWin unsupported, noch nicht getestet</li>
109-
<li>Python > 2.7 / Python >3.5</li>
119+
<li><strike>Python > 2.7</strike> / Python >3.5</li>
110120
</ul>
111121
<div class="columns">
112122
<div class="col">
113123
<h2>Managed Linux Host</h2>
114124
<ul>
115125
<li>ssh + sftp(kann auf scp gewechselt werden)</li>
116-
<li>Python > 2.7 / Python > 3.5</li>
126+
<li><strike>Python > 2.7</strike> / Python > 3.5</li>
117127
<li>Zusätzliche Python Module je nach Ansible Modul</li>
118128
</ul>
119129
</div>
@@ -123,7 +133,7 @@ <h2>Managed Windows Host</h2>
123133
<li>WinRM Konfiguration</li>
124134
<li><b>Powershell > 3.0</b> / .Net Framework 4.0</li>
125135
<li>Zusätzliche Powershell Module je nach Ansible Modul</li>
126-
<li>> Windows Server 2008</li>
136+
<li>> Windows Server <strike>2008</strike>2012</li>
127137
</ul>
128138
</div>
129139
</div>
@@ -143,6 +153,6 @@ <h2>Managed Windows Host</h2>
143153

144154
### Version Specific
145155
sudo pip install git+https://github.com/ansible/ansible.git@devel
146-
sudo pip install git+https://github.com/ansible/ansible.git@stable-2.5
156+
sudo pip install git+https://github.com/ansible/ansible.git@stable-2.9
147157
```
148158
</section>

slides/content/1_overview/4_inventory.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h3>Quelle</h3>
4848
[web]
4949
debian[1:5] ansible_host=10.0.1.[21:25]
5050

51-
[linux]
51+
[linux:children]
5252
web
5353
control
5454

slides/content/1_overview/7_demo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section data-markdown="">
2-
# Demo/Übung 1
2+
# Übung 1
33

44
** /workshop/1-addhoc/README.md **
55

slides/content/2_playbook_basics/2_playbook.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
</section>
163163

164164
<section data-markdown="">
165-
# Demo/Übung 2
165+
# Übung 2
166166

167167
** /workshop/2-basic-playbook/README.md **
168168

slides/content/3_playbook_advanced/4_jinja2.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<section data-markdown="">
22
# Jinja2 Templating / Ansible Filter
33

4-
Ansible beinhaltet die Jinja2 Templating Engine
4+
Ansible beinhaltet die Jinja2 Template Engine
55

66
Kann verwendet werden für:
77

@@ -159,7 +159,7 @@
159159
vars:
160160

161161
# Validate IP
162-
ip: "172.16.11.10" | ipaddr"
162+
ip: "172.16.11.10"
163163
validate_ip: "{{ ip | ipaddr }}" # Tested ob der String eine IP ist
164164
validate_ipv4: "{{ ip | ipv4 }}" # Tested ob der String eine IPv4 ist
165165
validate_ipv6: "{{ ip | ipv6 }}" # Tested ob der String eine IPv6 ist

slides/content/3_playbook_advanced/5_template.html

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ <h3>Play</h3>
4848

4949
<aside class="notes">
5050
<ul>
51+
<li>Der Variablen Scope vom Host wird hergenommen</li>
5152
<li>Templateing engine jinja2, wie zb. python flask, usw.</li>
5253
<li>Erkläre foreach</li>
5354
<li>Erkläre if</li>

slides/content/3_playbook_advanced/7_conditionals.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
when: foo is defined
4242

4343
- debug:
44-
msg: "We got don't have some WuUuU"
44+
msg: "We don't have some WuUuU"
4545
when: wuu is undefined
4646

4747
# Negating with not

slides/content/3_playbook_advanced/9_demo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section data-markdown="">
2-
# Demo/Übung 3
2+
# Übung 3
33

44
** /workshop/3-advanced-playbook/README.md **
55

0 commit comments

Comments
 (0)