Hinson's blog

π•°π–π–ˆπ–Šπ–‘π–‘π–Šπ–“π–ˆπ–Š π–Žπ–“ π–ˆπ–‘π–”π–šπ–‰ π–†π–—π–ˆπ–π–Žπ–™π–Šπ–ˆπ–™π–šπ–—π–Š 𝖆𝖓𝖉 π–˜π–Šπ–ˆπ–šπ–—π–Žπ–™π–ž π–‰π–”π–’π–†π–Žπ–“π–˜ π–Žπ–˜ π–™π–π–Š π–Šπ–™π–Šπ–—π–“π–†π–‘ π–•π–šπ–—π–˜π–šπ–Žπ–™ 𝖔𝖋 π–’π–ž π–•π–—π–”π–‹π–Šπ–˜π–˜π–Žπ–”π–“π–†π–‘ π–Œπ–—π–”π–œπ–™π–

Ansible learning note

Spread the love

Gathers facts from all hosts defined in a specific inventory file:


Content changed to trigger the restart of nginx:

- name: web content task
  .......
  register: content_result

- name: Restart nginx if content is changed
  service:
    name: nginx
    state: restarted
  when: content_result.changed

Leave a Reply

Your email address will not be published. Required fields are marked *