Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Event Driven Automation

This is my repository of the roles I use to manage most of my infrastructure and other things. The idea is I would use event driven ansible to perform automatic configuration upon provisioning of whatever I set up just by making a web call with curl or something to it.

Configuration and Setup

  1. mkdir hosts.
  2. Add your inventory files to hosts/.
  3. Create your own vars/private_config.yml from vars/private_config_example.yml.
  4. Modify the private_key_file variable in ansible.cfg to point to the correct path for your SSH private key.
  5. Run: ansible-rulebook -r rulebook.yml -i hosts/ -vv
    1. If you are using a directory for your inventory, you have to put a "/" at the end to indicate it is a directory.
  6. On a test host, run: curl http://ansible-eda:6000 -d '{"host": "test-host-1", "cloud-init-setup": true}'

Install Ansible

pipx install --include-deps ansible-core
pipx inject --include-apps --include-deps ansible-core ansible-dev-tools
pipx inject --include-apps --include-deps ansible-core dnspython
pipx inject --include-apps --include-deps ansible-core jmespath
pipx inject --include-apps --include-deps ansible-core netaddr
pipx inject --include-apps --include-deps ansible-core requests
pipx inject --include-apps --include-deps ansible-core selinux

Ansible Galaxy

ansible-galaxy collection install --upgrade \
  ansible.posix \
  ansible.utils \
  cloud.common \
  community.general \
  containers.podman \
  kubernetes.core

Updating the Environment

  1. Update the python pipx environment:

    pipx upgrade-all --include-injected
  2. Re-run the ansible-galaxy command to update the ansible modules.

About

Event Driven Ansible, and a role dumping ground

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages