Table of Contents

CI / CD Ansible

Best practice ansible

awx

https://medium.com/@mitesh_shamra/ansible-roles-1d1954f9932a

ansible plabooks community

https://galaxy.ansible.com/

https://www.digitalocean.com/community/tutorials/how-to-configure-apache-using-ansible-on-ubuntu-14-04

Automate Let's Encrypt Certificate Install on VMware vSphere ESXi

command module

https://docs.ansible.com/ansible/latest/modules/command_module.html

asnible blog

https://adminswerk.de/multi-line-string-yaml-ansible-I/

https://adminswerk.de/multi-line-string-yaml-ansible-II/

checksum ansible

* sample

Sample
---
- hosts: test-server
  tasks:
    - stat:
        path: "{{ item }}"
        checksum_algorithm: sha1
      delegate_to: localhost
      with_fileglob: /tmp/*.dat
      register: local_files
    - stat:
        path: "/tmp/{{ item.stat.path | basename }}"
        checksum_algorithm: sha1
      failed_when: remote_files.stat.checksum != item.stat.checksum
      # failed_when condition checked after every iteration
      #   and remote_files here is a result of individual task
      #   but after loop is finished, remote_files is a cobination
      #   of all iterations results
      with_items: "{{ local_files.results }}"
      register: remote_files
      loop_control:
        label: "{{ item.stat.path | basename }}"