Skip to content

Instantly share code, notes, and snippets.

View freuds's full-sized avatar

freuds

  • Paris
  • 08:17 (UTC +01:00)
View GitHub Profile
@freuds
freuds / ansible_conditionals_examples.yaml
Created March 3, 2017 14:51 — forked from marcusphi/ansible_conditionals_examples.yaml
Ansible 1.3 Conditional Execution -- Very complete example with comments -- I find the conditional expressions to be ridiculously hard to get right in Ansible. I don't have a good model of what's going on under the surface so I often get it wrong. What makes it even harder is that there has been at least three different variants over the course …
---
# This has been tested with ansible 1.3 with these commands:
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts"
# NB: The type of the variable is crucial!
- name: Ansible Conditionals Examples
hosts: $hosts
vars_files:
@freuds
freuds / memento.md
Last active November 18, 2022 20:37
Commandes de Docker

Commandes de Docker

Commandes de bases

run

La commande run permet d'instancier un container à partir d'une image. Executer une instruction dans un container :

docker run ubuntu:14.04 echo "hello world"

Affiche : hello world