Commit 52622014 authored by Ing. Matej Madeja's avatar Ing. Matej Madeja
Browse files

explained roles vs. tasks + roles examples

parent 7bed13a9
......@@ -3,11 +3,9 @@
hosts:
- devices
vars:
- bgUrl: https://edmontongazette.com/wp-content/uploads/2018/07/Women-CEO.jpg
roles:
- common
- office
---
- name: "Install base pkg"
hosts:
- devices
vars:
companyBg: "company-bg.jpg"
servers:
- galaxy
- vulcan
- ameros
vars_files:
- vars.yml
ansible_connection: ssh
\ No newline at end of file
ansible_connection: local
\ No newline at end of file
---
# defaults file for common
\ No newline at end of file
# defaults file for common
companyBg: "company-bg.jpg"
servers:
- galaxy
- vulcan
- ameros
bgUrl: http://nieco.com/image.jpg
\ No newline at end of file
---
# tasks file for common
- name: "Print var"
debug:
var: moja_premenna
- name: "Template"
template:
src: template.j2
......@@ -38,7 +34,7 @@
- name: Download bg image
get_url:
url: https://cdn.wallpapersafari.com/55/73/ghY4rc.jpg
url: "{{ bgUrl }}"
dest: "{{ ansible_user_dir }}/Pictures/{{ companyBg }}"
tags:
- bg
......
......@@ -3,6 +3,8 @@
hosts:
- devices
vars:
- bgUrl: https://cdn.wallpapersafari.com/55/73/ghY4rc.jpg
roles:
- common
......
......@@ -2,6 +2,9 @@
- name: "Management group install"
hosts:
- devices
vars:
- bgUrl: https://www.reactive-executive.com/wp-content/uploads/2017/12/Change-Management.jpg
- import_playbook: development.yml
- import_playbook: adminitrative.yml
......
moja_premenna: "toto je test"
\ No newline at end of file
predmety
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment