Complete Sat6 integration

Various fixes to get sat-6 integration working.

* inventory_import.py - the inventory script is called foreman.py
* tasks.py - be sure to call `add_section()` before using it
* defaults.py - Add various SATELLITE6_* enablement variables

Relates #3119
This commit is contained in:
James Laska 2016-07-25 15:09:16 -04:00
parent 60e012f75b
commit 11d68d1ebe
5 changed files with 13 additions and 1 deletions

View File

@ -481,6 +481,7 @@ def load_inventory_source(source, all_group=None, group_filter_re=None,
# Sanity check: We sanitize these module names for our API but Ansible proper doesn't follow
# good naming conventions
source = source.replace('azure.py', 'windows_azure.py')
source = source.replace('satellite6.py', 'foreman.py')
logger.debug('Analyzing type of source: %s', source)
original_all_group = all_group
if not os.path.exists(source):

View File

@ -1299,9 +1299,11 @@ class RunInventoryUpdate(BaseTask):
cp.set(section, 'password', decrypt_field(credential, 'password'))
section = 'ansible'
cp.add_section(section)
cp.set(section, 'group_patterns', '["{app}-{tier}-{color}", "{app}-{color}", "{app}", "{tier}"]')
section = 'cache'
cp.add_section(section)
cp.set(section, 'path', '/tmp')
cp.set(section, 'max_age', '0')

0
awx/plugins/inventory/cloudforms.py Normal file → Executable file
View File

1
awx/plugins/inventory/foreman.py Normal file → Executable file
View File

@ -4,7 +4,6 @@
#
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -672,6 +672,16 @@ OPENSTACK_HOST_FILTER = r'^.+$'
OPENSTACK_EXCLUDE_EMPTY_GROUPS = True
OPENSTACK_INSTANCE_ID_VAR = 'openstack.id'
# ---------------------
# ----- Foreman -----
# ---------------------
SATELLITE6_ENABLED_VAR = 'foreman.enabled'
SATELLITE6_ENABLED_VALUE = 'true'
SATELLITE6_GROUP_FILTER = r'^.+$'
SATELLITE6_HOST_FILTER = r'^.+$'
SATELLITE6_EXCLUDE_EMPTY_GROUPS = True
SATELLITE6_INSTANCE_ID_VAR = 'foreman.uuid'
# ---------------------
# -- Activity Stream --
# ---------------------