Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add '--run-ansible-roles' flag #309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

giovannisciortino
Copy link

@giovannisciortino giovannisciortino commented May 2, 2019

Satellite from version 6.4 support the execution on ansible roles associated to hosts.

As reported in #308 , sometimes could be useful to run ansible roles associated to host just after the host registration trough bootstrap.py.

In this PR, a new flag on bootstrap.py script has been added in order to trigger automatically the execution of the Ansible roles associated to the host after its registration.

Note: The ansible roles can be associated to an host during registration process associating them to a hostgroup.

This new feature is disabled by default, it's enabled only when bootstrap.py is called with the flag --run-ansible-roles.
Below an output of the execution of bootstrap.py with this flag:

./bootstrap.py -l admin   --password password   -s satellite.work.lab   -o Org1   -L Location1   -g ansible_roles_hostgroup   -a Activaction_Key1   --skip=prereq-update --unmanaged --skip-puppet --run-ansible-roles
...
[NOTIFICATION], [2019-05-02 12:49:45], [Calling run_ansible_roles]
[RUNNING], [2019-05-02 12:49:45], [Calling Foreman API to retrieve job template id of 'Ansible Roles - Ansible Default']
[RUNNING], [2019-05-02 12:49:45], [Calling Foreman API to execute 'Ansible Roles - Ansible Default' job]
[SUCCESS], [2019-05-02 12:49:45], [Job template 'Ansible Roles - Ansible Default' executed. Job id: 24], completed successfully.

@giovannisciortino giovannisciortino force-pushed the pull-issue-308 branch 5 times, most recently from 2f96b8c to 407a883 Compare May 2, 2019 14:16
@giovannisciortino
Copy link
Author

I have seen that the Travis CI build fails for this PR but this maybe isn't caused by changes introduced by my PR.

The build fails with the errors reported below but I haven't modified the lines 307,886,885 and 1163.
Furthermore I modified temporary my commit not introducing any change in any file and the build process fails with the same errors.

python -m flake8 --ignore E501,W504 ./bootstrap.py ./setup.py
python -m pylint --reports=n --disable=I --ignore-imports=y ./bootstrap.py ./setup.py
************* Module bootstrap
bootstrap.py:307:4: R1705: Unnecessary "elif" after "return" (no-else-return)
bootstrap.py:866:4: R1705: Unnecessary "elif" after "return" (no-else-return)
bootstrap.py:885:4: R1705: Unnecessary "elif" after "return" (no-else-return)
bootstrap.py:1163:18: W1505: Using deprecated method linux_distribution() (deprecated-method)
bootstrap.py:1165:18: W1505: Using deprecated method dist() (deprecated-method)
-----------------------------------
Your code has been rated at 9.95/10
make: *** [lint] Error 12
The command "make test" exited with 2.
Done. Your build exited with 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant