Satellite: Testing ansible roles in GIT repo

Posted on

Looking for some some guidance on how to properly test ansible roles used in satellite remote execution.

Currently Ive got a ansible git repo containing roles checked out that I do changes in and are running ansible manually on my laptop to test the changes and then merge the changes to GIT and then git pull to Satellite master.

I just not sure how to configure my local "ansible dev environment"

EDIT: answering my own question. So after some digging around I used the ansible foreman inventory plugin (https://docs.ansible.com/ansible/latest/plugins/inventory/foreman.html) and pointed it to satellite.

Got a testing playbook playbook_role.yml like:

- hosts: all
   roles:
    - ntp

I could then test local changes before committing them to GIT with:
ansible-playbook -l somehost.mydomain playbook_role.yml -CD

And also test ansible variable overides in satellite using:

- hosts: all
   vars:
     - some_variable: "some_value"
   roles:
     - ntp

Responses