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 ansible example #197

Merged
merged 1 commit into from
Jan 6, 2018
Merged

add ansible example #197

merged 1 commit into from
Jan 6, 2018

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Jul 18, 2017

No description provided.

@dglinder
Copy link

Since running the bootstrap.py can take quite a while, I'd suggest the addition of a "stat" module call and only run the bootstrap.py if the client does NOT have a .pem file. The bootstrap.py uses this file as a signal to exit but doing this in Ansible eliminates the Python interpreter call altogether. (And the "force_all_plays_to_run" can be set to true to override this check if necessary.)

 - name: Check for existing Satellite certificate file
   stat: path=/etc/rhsm/ca/katello-server-ca.pem
   register: katello_pem

 - name: Execute the bootstrap.py script
   command: "/var/tmp/bootstrap.py ...."
   when: not katello_pem.stat.exists or force_all_plays_to_run|bool

@evgeni
Copy link
Member Author

evgeni commented Aug 26, 2017

I must admit I don't see the benefit here. Checking that pem is pretty much the first thing bootstrap does.
And unless you pass bootstrap_additional_args: --force to the playbook, you get exactly the behavior you want, no? The only thing you would save is the start up of the python interpreter itself. And that's pretty quick.

@dglinder
Copy link

Was the PEM check always there? I though an early version I used re-ran it regardless. Adding in the check saves copying the script. Again, not a big deal in the grand scheme of things so in your environment it might make sense to copy and run regardless.

@evgeni
Copy link
Member Author

evgeni commented Aug 27, 2017

The PEM check is there since #120, so no, not always :)

@dglinder
Copy link

Ok - I retract my comment/addition as it is not directly aligned with the usage of the bootstrap.py script within an Ansible playbook.

evgeni added a commit to evgeni/satellite-performance that referenced this pull request Sep 1, 2017
based on Katello/katello-client-bootstrap#197

will always run bootstrap with --force, so be careful ;)

if you don't define bootstrap_login/bootstrap_password it will not try
to do puppet, otherwise it will
evgeni added a commit to evgeni/satellite-performance that referenced this pull request Sep 1, 2017
based on Katello/katello-client-bootstrap#197

will always run bootstrap with --force, so be careful ;)

if you don't define bootstrap_login/bootstrap_password it will not try
to do puppet, otherwise it will
jhutar pushed a commit to redhat-performance/satperf that referenced this pull request Sep 17, 2017
based on Katello/katello-client-bootstrap#197

will always run bootstrap with --force, so be careful ;)

if you don't define bootstrap_login/bootstrap_password it will not try
to do puppet, otherwise it will
@sean797
Copy link
Member

sean797 commented Oct 26, 2017

Can this example also delete bootstrap.py after?

@dglinder
Copy link

@sean797 - Sure, the example would just need a "file:" module call with "state: absent". Something like this (untested):

 - name: Execute the bootstrap.py script
   file:
     path: /var/tmp/bootstrap.py
     state: absent

@evgeni
Copy link
Member Author

evgeni commented Jan 6, 2018

this has so far only got positive feedback, and given it's not a code change, but an example, I am going to just merge that now :)

@evgeni evgeni merged commit 3e6bae1 into Katello:master Jan 6, 2018
evgeni added a commit to evgeni/katello-client-bootstrap that referenced this pull request Jan 23, 2018
* make bootstrap.py compatible with Puppet 4 (Katello#230)
* add ansible example playbook (Katello#197)
* remove SAMs CA consumer RPM in remove_obsolete_packages() (Katello#234)
* allow FIPS enabled systems to register successfully with puppet (Katello#236)
* allow configuring timeout for API calls and subscription-manager (Katello#237)
* implement switching proxy / caps without destroying the host in Foreman (Katello#227)
@evgeni evgeni mentioned this pull request Jan 23, 2018
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.

3 participants