I am looking for suggestions for implementing Ansible pull model. The pull mode is essential for bootstrapping new systems and auto-scaling not launched by Ansible.
I’ve looked at ansible-pull command, but it downloads entire Git repository before running a playbook. This may not be an ideal option for following reasons:
- Inefficient as repository size increases
- Exposes entire repository all nodes and not just the config needed by a particular node
I’ve hacked together following four lines to glue requirements, playbook with a application. The application/node/system gets role requirements first and then runs a playbook which uses those roles. In most cases, playbook includes only a list of roles. It works fine, however, it hasn’t considered various conditions yet.
curl --silent -o requirements.yml “https://repository/browse/applications/$app/$tier/requirements.yml”
curl --silent -o playbook.yml “https://repository/browse/applications/$app/$tier/playbook.yml”
ansible-galaxy -vvv install requirements.yml
ansible-playbook -vvv playbook.yml
I was wondering if anyone has other ideas or workflows or (free) tool suggestions for using Ansible in pull mode.