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

1.6.0 RFE Assign location without foreman #243

Merged
merged 1 commit into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Evgeni Golov <evgeni@golov.de>
François Cami <fcami@fedoraproject.org>
Johan Bergström <bergsjoh@gmail.com>
Johan Swensson <jswensso@redhat.com>
Joseph Pisciotta <jpisciotta@redhat.com>
karmab <karimboumedhel@gmail.com>
Lukas Zapletal <lzap+git@redhat.com>
Marcelo Moreira de Mello <mmello@redhat.com>
Expand Down
12 changes: 11 additions & 1 deletion bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,20 @@ def generate_katello_facts():
"""
Write katello_facts file based on FQDN. Done after installation
of katello-ca-consumer RPM in case the script is overriding the
FQDN
FQDN. Place the location if the location option is included
"""

print_generic("Writing FQDN katello-fact")
katellofacts = open('/etc/rhsm/facts/katello.facts', 'w')
katellofacts.write('{"network.hostname-override":"%s"}\n' % (FQDN))
katellofacts.close()

if options.location and 'foreman' in options.skip:
print_generic("Writing LOCATION RHSM fact")
locationfacts = open('/etc/rhsm/facts/location.facts', 'w')
locationfacts.write('{"foreman_location":"%s"}\n' % (options.location))
locationfacts.close()


def install_puppet_agent():
"""Install and configure, then enable and start the Puppet Agent"""
Expand Down Expand Up @@ -1250,6 +1257,9 @@ def exec_service(service, command, failonerror=True):
if options.enablerepos:
enable_repos()

if options.location and 'foreman' in options.skip:
delete_file('/etc/rhsm/facts/location.facts')

if not options.remove and not options.new_capsule:
# > IF not removing, install Katello agent, optionally update host,
# > optionally clean and install Puppet agent
Expand Down