Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Samenvatting BS2 Overzicht kort code - ansible - docker compose

Rating
-
Sold
-
Pages
2
Uploaded on
17-01-2023
Written in
2021/2022

BS2 Overzicht kort code - ansible - docker compose

Institution
Module

Content preview

ANSIBLE (PLAYBOOK)
LOOP MET BESTANDEN
- hosts: webservers
vars: file.yml aanmaken
- bestanden: $ nano file.yml
- passwords.txt
uitvoeren
- schattigekatjes.jpg $ansible-playbook file.yml
- cosci_prices.xlsx
inloggen om kijken gelukt (kijken of files aangemaakt zijn)
tasks: $ssh root@172.16.23.11
- name: Create files
file: !! hosts: webserver → verwijst naar file
hosts
path: /root/ "{{item}}"
state: touch
→ voor elke host in webserver wordt de
loop: "{{bestanden}}" playbook uitgevoerd




- hosts: webservers playbook om bestand met hi op webservers te maken
tasks:
- name: create a motd
file:
path: /root/motd
state: touch

- name: Registering a variable
shell: cat /root/motd
register: cmd_result

- name: It didnt say hi
shell: echo 'hi' > /root/motd
when: cmd_result.stdout.find('hi') == -1

- name: It said hi
shell: echo 'bye' > /root/motd
when: cmd_result.stdout.find('hi') != -1

Written for

Institution
Study
Module

Document information

Uploaded on
January 17, 2023
Number of pages
2
Written in
2021/2022
Type
SUMMARY

Subjects

£4.04
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
marlenebraem
4.0
(1)

Get to know the seller

Seller avatar
marlenebraem UC Leuven-Limburg
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
3 year
Number of followers
1
Documents
23
Last sold
2 months ago

4.0

1 reviews

5
0
4
1
3
0
2
0
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions