linux_wiki:ansible-pull

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:ansible-pull [2018/07/21 00:18]
billdozor [The Client: Putting It All Together]
linux_wiki:ansible-pull [2019/05/25 23:50] (current)
Line 49: Line 49:
  
 Example of a playbook tailored for pulling. Example of a playbook tailored for pulling.
-<code bash>+<code yaml>
 # File: myplaybook.yml # File: myplaybook.yml
 # Description: Playbook used to execute on the local system via ansible-pull # Description: Playbook used to execute on the local system via ansible-pull
Line 71: Line 71:
  
 \\ \\
-File: myrole/tasks/main.yml +File: myrole/tasks/main.yml  -> Installs a list of applications using the variable "my_awesome_apps" and notifies a handler if anything changes 
-<code bash></code>+<code yaml> 
 +- name: Install my awesome app list 
 +  yum: 
 +    name: "{{ my_awesome_apps }}" 
 +    state: present 
 +  notify: restart my awesome service 
 +</code>
  
 \\ \\
-File: myrole/vars/main.yml +File: myrole/vars/main.yml  -> Variable that contains a list of applications to install 
-<code bash></code>+<code yaml> 
 +my_awesome_apps: 
 + - myapp1 
 + - myapp2 
 +</code>
  
 \\ \\
-File: myrole/vars/handlers.yml +File: myrole/vars/handlers.yml  -> Handler that restarts a service when triggered 
-<code bash></code>+<code yaml> 
 +- name: restart my awesome service 
 +  service: 
 +    name: my-awesome-service 
 +    state: restarted 
 +</code>
  
 ---- ----
  • linux_wiki/ansible-pull.1532146733.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)