diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ca137cb..eec271e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,25 +15,18 @@ jobs: matrix: python: ["2.7", "3.5", "3.6", "3.7"] ansible: - - stable-2.7 - stable-2.8 - stable-2.9 - devel exclude: - - python: "2.7" - ansible: "stable-2.7" - python: "2.7" ansible: "stable-2.8" - python: "2.7" ansible: "stable-2.9" - - python: "3.5" - ansible: "stable-2.7" - python: "3.5" ansible: "stable-2.8" - python: "3.5" ansible: "stable-2.9" - - python: "3.6" - ansible: "stable-2.7" - python: "3.6" ansible: "stable-2.8" - python: "3.6" @@ -46,6 +39,12 @@ jobs: python-version: ${{ matrix.python }} - name: Install Ansible run: pip install git+https://github.com/ansible/ansible.git@${{ matrix.ansible }}#egg=ansible + - name: Set Environment to use mazer + run: | + echo "::set-env name=COLLECTION_COMMAND::mazer" + echo "::set-env name=COLLECTION_COMMAND_SUFFIX::" + pip install mazer + if: matrix.ansible == 'stable-2.8' - name: Install dependencies run: make test-setup - name: fake redhat-uep.pem for redhat_manifest module diff --git a/Makefile b/Makefile index 8666b265..a4bab1b6 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,12 @@ VERSION := $(shell python -c 'import yaml; print(yaml.safe_load(open("galaxy.yml MANIFEST := build/collections/ansible_collections/$(NAMESPACE)/$(NAME)/MANIFEST.json PLUGIN_TYPES := $(filter-out __%,$(notdir $(wildcard plugins/*))) -METADATA := galaxy.yml LICENSE README.md +METADATA := galaxy.yml LICENSE README.md meta/runtime.yml $(foreach PLUGIN_TYPE,$(PLUGIN_TYPES),$(eval _$(PLUGIN_TYPE) := $(filter-out %__init__.py,$(wildcard plugins/$(PLUGIN_TYPE)/*.py)))) DEPENDENCIES := $(METADATA) $(foreach PLUGIN_TYPE,$(PLUGIN_TYPES),$(_$(PLUGIN_TYPE))) PYTHON_VERSION = 3.7 +COLLECTION_COMMAND ?= ansible-galaxy SANITY_OPTS = --venv TEST= PYTEST=pytest -n 4 --boxed -v @@ -41,26 +42,26 @@ sanity: $(MANIFEST) # Fake a fresh git repo for ansible-test cd $( .gitignore ; ansible-test sanity $(SANITY_OPTS) --python $(PYTHON_VERSION) -test: | tests/test_playbooks/vars/server.yml +test: $(MANIFEST) | tests/test_playbooks/vars/server.yml $(PYTEST) $(TEST) -test-crud: | tests/test_playbooks/vars/server.yml +test-crud: $(MANIFEST) | tests/test_playbooks/vars/server.yml $(PYTEST) 'tests/test_crud.py::test_crud' -test-check-mode: | tests/test_playbooks/vars/server.yml +test-check-mode: $(MANIFEST) | tests/test_playbooks/vars/server.yml $(PYTEST) 'tests/test_crud.py::test_check_mode' test-other: $(PYTEST) -k 'not test_crud.py' -test_%: FORCE | tests/test_playbooks/vars/server.yml +test_%: FORCE $(MANIFEST) | tests/test_playbooks/vars/server.yml pytest -v 'tests/test_crud.py::test_crud[$*]' 'tests/test_crud.py::test_check_mode[$*]' -record_%: FORCE +record_%: FORCE $(MANIFEST) $(RM) tests/test_playbooks/fixtures/$*-*.yml pytest -v 'tests/test_crud.py::test_crud[$*]' --record -clean_%: FORCE +clean_%: FORCE $(MANIFEST) ansible-playbook --tags teardown,cleanup -i tests/inventory/hosts 'tests/test_playbooks/$*.yml' setup: test-setup @@ -74,33 +75,32 @@ tests/test_playbooks/vars/server.yml: @echo "For recording, please adjust $@ to match your reference server." dist-test: $(MANIFEST) - ANSIBLE_COLLECTIONS_PATHS=build/collections ansible -m $(NAMESPACE).$(NAME).foreman_organization -a "username=admin password=changeme server_url=https://foreman.example.test name=collectiontest" localhost | grep -q "Failed to connect to Foreman server" - ANSIBLE_COLLECTIONS_PATHS=build/collections ansible-doc $(NAMESPACE).$(NAME).foreman_organization | grep -q "Manage Foreman Organization" + ANSIBLE_COLLECTIONS_PATHS=build/collections ansible -m $(NAMESPACE).$(NAME).organization -a "username=admin password=changeme server_url=https://foreman.example.test name=collectiontest" localhost | grep -q "Failed to connect to Foreman server" + ANSIBLE_COLLECTIONS_PATHS=build/collections ansible-doc $(NAMESPACE).$(NAME).organization | grep -q "Manage Organization" $(MANIFEST): $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz +ifeq ($(COLLECTION_COMMAND),mazer) + # No idea, why this fails. But mazer is old and deprecated so unlikely to beeing fixed... + # mazer install --collections-path build/collections $< + -mkdir build/collections build/collections/ansible_collections build/collections/ansible_collections/$(NAMESPACE) build/collections/ansible_collections/$(NAMESPACE)/$(NAME) + tar xf $< -C build/collections/ansible_collections/$(NAMESPACE)/$(NAME) +else ansible-galaxy collection install -p build/collections $< --force +endif -# fix the imports to use the collection namespace -build/src/plugins/modules/%.py: plugins/modules/%.py | build - sed -e '/ansible.module_utils.foreman_helper/ s/ansible.module_utils/ansible_collections.$(NAMESPACE).$(NAME).plugins.module_utils/g' \ - -e '/extends_documentation_fragment/{:1 n; s/- foreman/- $(NAMESPACE).$(NAME).foreman/; t1}' $< > $@ - -build/src/plugins/inventory/%.py: plugins/inventory/%.py | build - sed -E -e '/NAME =/ s/foreman/$(NAMESPACE).$(NAME).foreman/' \ - -e '/(plugin|choices):/ s/foreman/$(NAMESPACE).$(NAME).foreman/' $< > $@ - -build/src/plugins/callback/%.py: plugins/callback/%.py | build - sed -e '/CALLBACK_NAME =/ s/foreman/$(NAMESPACE).$(NAME).foreman/' \ - -e '/callback:/ s/foreman/$(NAMESPACE).$(NAME).foreman/' $< > $@ - -build/src/%: % | build +build/src/%: % | build/src cp $< $@ -build: - -mkdir build build/src build/src/plugins $(addprefix build/src/plugins/,$(PLUGIN_TYPES)) +build/src: + -mkdir build build/src build/src/meta build/src/plugins $(addprefix build/src/plugins/,$(PLUGIN_TYPES)) -$(NAMESPACE)-$(NAME)-$(VERSION).tar.gz: $(addprefix build/src/,$(DEPENDENCIES)) | build +$(NAMESPACE)-$(NAME)-$(VERSION).tar.gz: $(addprefix build/src/,$(DEPENDENCIES)) | build/src +ifeq ($(COLLECTION_COMMAND),mazer) + mazer build --collection-path=build/src + cp build/src/releases/$@ . +else ansible-galaxy collection build build/src --force +endif dist: $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz @@ -109,9 +109,12 @@ clean: doc-setup: pip install -r docs/requirements.txt -doc: +doc: $(MANIFEST) make -C docs html +branding: + sed -i 's/theforeman\.foreman/redhat.satellite/g' plugins/*/*.py tests/inventory/tests.foreman.yml tests/test_module_state.py tests/test_playbooks/*.yml + FORCE: .PHONY: help dist lint sanity test test-crud test-check-mode test-other setup test-setup FORCE diff --git a/ansible.cfg b/ansible.cfg index 1ab2184f..d7b4c14d 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,11 +1,4 @@ [defaults] -library = plugins/modules -module_utils = plugins/module_utils -doc_fragment_plugins = plugins/doc_fragments -filter_plugins = plugins/filter -inventory_plugins = plugins/inventory -callback_plugins = plugins/callback +collections_paths = build/collections inventory = tests/inventory/hosts retry_files_enabled = False -stdout_callback = debug -stderr_callback = debug diff --git a/docs/Makefile b/docs/Makefile index fabce4a5..f6149a94 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -21,7 +21,7 @@ $(ANSIBLEGIT): generate-docs: $(ANSIBLEGIT) rm -rf ./modules/ - bash -c "source $(ANSIBLEGIT)/hacking/env-setup && ANSIBLE_DOC_FRAGMENT_PLUGINS=../plugins/doc_fragments python3 $(ANSIBLEGIT)/hacking/build-ansible.py document-plugins --module-dir ../plugins/modules --template-dir ./_templates --template-dir $(ANSIBLEGIT)/docs/templates --type rst --output-dir ./modules/" + bash -c "source $(ANSIBLEGIT)/hacking/env-setup && ANSIBLE_COLLECTIONS_PATHS=../build/collections python3 $(ANSIBLEGIT)/hacking/build-ansible.py document-plugins --module-dir ../plugins/modules --template-dir ./_templates --template-dir $(ANSIBLEGIT)/docs/templates --type rst --output-dir ./modules/" # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/docs/developing.md b/docs/developing.md index db4df897..1ceeec28 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -2,7 +2,7 @@ First of all, please have a look at the [Ansible module development](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html) guide and get familiar with the general Ansible module layout. -When looking at actual modules in this repository ([`foreman_domain`](../plugins/modules/foreman_domain.py) is a nice short example), you will notice a few differences to a "regular" Ansible module: +When looking at actual modules in this repository ([`domain`](../plugins/modules/domain.py) is a nice short example), you will notice a few differences to a "regular" Ansible module: * Instead of `AnsibleModule`, we use `ForemanEntityAnsibleModule` (and a few others, see [`plugins/module_utils/foreman_helper.py`](../plugins/module_utils/foreman_helper.py)) which provides an abstraction layer for talking with the Foreman API * Instead of Ansible's `argument_spec`, we provide an enhanced version called `foreman_spec`. It handles the translation from Ansible module arguments to Foreman API parameters, as nobody wants to write `organization_ids` in their playbook when they can write `organizations` @@ -42,8 +42,8 @@ The rest of the module is usually very minimalistic: if __name__ == '__main__': main() ``` -You can see a complete example of simple module in [`foreman_architecture`](../plugins/modules/foreman_architecture.py) -In some cases, you will have to handle some custom workflows/validations, you can see some examples in [`foreman_bookmark`](../plugins/modules/foreman_bookmark.py), [`foreman_compute_attribute`](../plugins/modules/foreman_compute_attribute.py), [`foreman_hostgroup`](../plugins/modules/foreman_hostgroup.py), [`foreman_provisioning_template`](../plugins/modules/foreman_provisioning_template.py)... +You can see a complete example of simple module in [`architecture`](../plugins/modules/architecture.py) +In some cases, you will have to handle some custom workflows/validations, you can see some examples in [`bookmark`](../plugins/modules/bookmark.py), [`compute_attribute`](../plugins/modules/compute_attribute.py), [`hostgroup`](../plugins/modules/hostgroup.py), [`provisioning_template`](../plugins/modules/provisioning_template.py)... ## Specification of the `foreman_spec` @@ -57,7 +57,7 @@ This is usually combined with `flat_name=_id`. If no flat_name is provid This is usually combined with `flat_name=_ids`. If no flat_name is provided, fallback to `singularize()_ids` where entity is the foreman_spec key. eg `organizations=dict(type='entity_list')` => `flat_name=organization_ids`. * `type='nested_list'` The referenced value is a list of Foreman entities that are not included in the main API call. The module must handle the entities separately. -See domain parameters in [`foreman_domain`](../plugins/modules/foreman_domain.py) for an example. +See domain parameters in [`domain`](../plugins/modules/domain.py) for an example. The sub entities must be described by `foreman_spec=_spec`. * `type='invisible'` The parameter is available to the API call, but it will be excluded from Ansible's `argument_spec`. * `search_by='login'`: Used with `type='entity'` or `type='entity_list'`. Field used to search the sub entity. Defaults to value provided by `ENTITY_KEYS` or 'name' if no value found. @@ -93,7 +93,7 @@ required_plugins=[ ] ``` -Or specific parameters, like the `discovery_proxy` parameter of `foreman_subnet` which needs the Discovery plugin: +Or specific parameters, like the `discovery_proxy` parameter of `subnet` which needs the Discovery plugin: ```python required_plugins=[ ('discovery', ['discovery_proxy']), diff --git a/galaxy.yml b/galaxy.yml index 232f7a3f..73e2f77d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -49,7 +49,7 @@ authors: - "metalcated " - "russianguppie <46544650+russianguppie@users.noreply.github.com>" - "willtome " -version: "0.8.1" +version: "1.0.0" license: - "GPL-3.0-or-later" tags: diff --git a/meta/runtime.yml b/meta/runtime.yml new file mode 100644 index 00000000..52e97571 --- /dev/null +++ b/meta/runtime.yml @@ -0,0 +1,106 @@ +plugin_routing: + modules: + foreman_architecture: + redirect: architecture + foreman_auth_source_ldap: + redirect: auth_source_ldap + foreman_bookmark: + redirect: bookmark + foreman_compute_attribute: + redirect: compute_attribute + foreman_compute_profile: + redirect: compute_profile + foreman_compute_resource: + redirect: compute_resource + foreman_config_group: + redirect: config_group + foreman_domain: + redirect: domain + foreman_environment: + redirect: puppet_environment + foreman_external_usergroup: + redirect: external_usergroup + foreman_global_parameter: + redirect: global_parameter + foreman_hostgroup: + redirect: hostgroup + foreman_host_power: + redirect: host_power + foreman_host: + redirect: host + foreman_image: + redirect: image + foreman_installation_medium: + redirect: installation_medium + foreman_job_template: + redirect: job_template + foreman_location: + redirect: location + foreman_model: + redirect: hardware_model + foreman_operatingsystem: + redirect: operatingsystem + foreman_organization: + redirect: organization + foreman_os_default_template: + redirect: os_default_template + foreman_provisioning_template: + redirect: provisioning_template + foreman_ptable: + redirect: partition_table + foreman_realm: + redirect: realm + foreman_role: + redirect: role + foreman_scap_content: + redirect: scap_content + foreman_scap_tailoring_file: + redirect: scap_tailoring_file + foreman_scc_account: + redirect: scc_account + foreman_scc_product: + redirect: scc_product + foreman_search_facts: + redirect: resource_info + foreman_setting: + redirect: setting + foreman_smart_class_parameter: + redirect: smart_class_parameter + foreman_snapshot: + redirect: snapshot + foreman_subnet: + redirect: subnet + foreman_templates_import: + redirect: templates_import + foreman_usergroup: + redirect: usergroup + foreman_user: + redirect: user + katello_activation_key: + redirect: activation_key + katello_content_credential: + redirect: content_credential + katello_content_view_filter: + redirect: content_view_filter + katello_content_view: + redirect: content_view + katello_content_view_version: + redirect: content_view_version + katello_host_collection: + redirect: host_collection + katello_lifecycle_environment: + redirect: lifecycle_environment + katello_manifest: + redirect: subscription_manifest + katello_product: + redirect: product + katello_repository: + redirect: repository + katello_repository_set: + redirect: repository_set + katello_sync_plan: + redirect: sync_plan + katello_sync: + redirect: repository_sync + katello_upload: + redirect: content_upload diff --git a/plugins/callback/foreman.py b/plugins/callback/foreman.py index 2b6a8a0c..7ca7651e 100644 --- a/plugins/callback/foreman.py +++ b/plugins/callback/foreman.py @@ -8,7 +8,7 @@ __metaclass__ = type DOCUMENTATION = ''' - callback: foreman + callback: redhat.satellite.foreman type: notification short_description: Sends events to Foreman description: @@ -83,7 +83,7 @@ class CallbackModule(CallbackBase): CALLBACK_VERSION = 2.0 CALLBACK_TYPE = 'notification' - CALLBACK_NAME = 'foreman' + CALLBACK_NAME = 'redhat.satellite.foreman' CALLBACK_NEEDS_WHITELIST = True FOREMAN_HEADERS = { diff --git a/plugins/doc_fragments/foreman.py b/plugins/doc_fragments/foreman.py index 59bfc7ae..941440c7 100644 --- a/plugins/doc_fragments/foreman.py +++ b/plugins/doc_fragments/foreman.py @@ -38,7 +38,6 @@ class ModuleDocFragment(object): required: true type: str validate_certs: - aliases: [ verify_ssl ] description: Whether or not to verify the TLS certificates of the Foreman server default: true type: bool @@ -120,7 +119,7 @@ class ModuleDocFragment(object): options: state: description: - - State of the entity in Foreman + - State of the entity default: present choices: - present @@ -132,7 +131,7 @@ class ModuleDocFragment(object): options: state: description: - - State of the entity in Foreman + - State of the entity - C(present_with_defaults) will ensure the entity exists, but won't update existing ones default: present choices: @@ -242,27 +241,27 @@ class ModuleDocFragment(object): type: str content_source: description: - - Katello Content source. + - Content source. - Only available for Katello installations. required: false type: str lifecycle_environment: description: - - Katello Lifecycle environment. + - Lifecycle environment. - Only available for Katello installations. required: false type: str kickstart_repository: description: - Kickstart repository name. - - You need to provide this to use the "Synced Content" feature of Katello. + - You need to provide this to use the "Synced Content" feature. - Mutually exclusive with I(medium). - Only available for Katello installations. required: false type: str content_view: description: - - Katello Content view. + - Content view. - Only available for Katello installations. required: false type: str diff --git a/plugins/inventory/foreman.py b/plugins/inventory/foreman.py index bda1c4a7..5b7a08a4 100644 --- a/plugins/inventory/foreman.py +++ b/plugins/inventory/foreman.py @@ -21,7 +21,7 @@ plugin: description: token that ensures this is a source file for the C(foreman) plugin. required: True - choices: ['foreman'] + choices: ['redhat.satellite.foreman'] url: description: url to foreman default: 'http://localhost:3000' @@ -72,7 +72,7 @@ EXAMPLES = ''' # my.foreman.yml -plugin: foreman +plugin: redhat.satellite.foreman url: http://localhost:2222 user: ansible-tester password: secure @@ -101,7 +101,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable, Constructable): ''' Host inventory parser for ansible using foreman as source. ''' - NAME = 'foreman' + NAME = 'redhat.satellite.foreman' def __init__(self): diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index be2629a9..2ec65e35 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -17,7 +17,7 @@ from collections import defaultdict from functools import wraps -from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils._text import to_bytes, to_native from ansible.module_utils import six @@ -268,7 +268,7 @@ def __init__(self, **kwargs): server_url=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), - validate_certs=dict(type='bool', default=True, aliases=['verify_ssl']), + validate_certs=dict(type='bool', default=True), ) argument_spec.update(gen_args) argument_spec.update(kwargs.pop('argument_spec', {})) @@ -278,9 +278,6 @@ def __init__(self, **kwargs): super(ForemanAnsibleModule, self).__init__(argument_spec=argument_spec, supports_check_mode=supports_check_mode, **kwargs) - if 'verify_ssl' in self.params: - self.warn("Please use 'validate_certs' instead of deprecated 'verify_ssl'.") - aliases = {alias for arg in argument_spec.values() for alias in arg.get('aliases', [])} self.foreman_params = {k: v for (k, v) in self.params.items() if v is not None and k not in aliases} @@ -379,7 +376,7 @@ def _patch_subnet_rex_api(self): def check_requirements(self): if not HAS_APYPIE: - self.fail_json(msg='The apypie Python module is required', exception=APYPIE_IMP_ERR) + self.fail_json(msg=missing_required_lib("apypie"), exception=APYPIE_IMP_ERR) @_exception2fail_json(msg="Failed to connect to Foreman server: {0}") def connect(self): @@ -1173,7 +1170,7 @@ def parameter_value_to_str(value, parameter_type): # Helper for templates def parse_template(template_content, module): if not HAS_PYYAML: - module.fail_json(msg='The PyYAML Python module is required', exception=PYYAML_IMP_ERR) + module.fail_json(msg=missing_required_lib("PyYAML"), exception=PYYAML_IMP_ERR) try: template_dict = {} diff --git a/plugins/modules/katello_activation_key.py b/plugins/modules/activation_key.py similarity index 97% rename from plugins/modules/katello_activation_key.py rename to plugins/modules/activation_key.py index 9daa7c7b..d86ea3d5 100644 --- a/plugins/modules/katello_activation_key.py +++ b/plugins/modules/activation_key.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: katello_activation_key -short_description: Create and Manage Katello activation keys +module: activation_key +short_description: Create and manage activation keys description: - - Create and Manage Katello activation keys + - Create and manage activation keys author: "Andrew Kofink (@akofink)" options: name: @@ -143,17 +143,17 @@ - Name of the new activation key when state == copied type: str extends_documentation_fragment: - - foreman - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' -- name: "Create katello client activation key" - katello_activation_key: +- name: "Create client activation key" + activation_key: username: "admin" password: "changeme" server_url: "https://foreman.example.com" - name: "Katello Clients" + name: "Clients" organization: "Default Organization" lifecycle_environment: "Library" content_view: 'client content view' @@ -174,7 +174,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule def override_to_boolnone(override): diff --git a/plugins/modules/foreman_architecture.py b/plugins/modules/architecture.py similarity index 87% rename from plugins/modules/foreman_architecture.py rename to plugins/modules/architecture.py index ea734e66..f3f1b735 100644 --- a/plugins/modules/foreman_architecture.py +++ b/plugins/modules/architecture.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_architecture -short_description: Manage Foreman Architectures using Foreman API +module: architecture +short_description: Manage Architectures description: - - Create, Update and Delete Foreman Architectures using Foreman API + - Create, update, and delete Architectures author: - "Manisha Singhal (@Manisha15) ATIX AG" options: @@ -45,13 +45,13 @@ type: list elements: str extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: "Create an Architecture" - foreman_architecture: + architecture: name: "i386" operatingsystems: - "TestOS1" @@ -62,7 +62,7 @@ state: present - name: "Update an Architecture" - foreman_architecture: + architecture: name: "i386" operatingsystems: - "TestOS3" @@ -73,7 +73,7 @@ state: present - name: "Delete an Architecture" - foreman_architecture: + architecture: name: "i386" server_url: "https://foreman.example.com" username: "admin" @@ -83,7 +83,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanArchitectureModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_auth_source_ldap.py b/plugins/modules/auth_source_ldap.py similarity index 93% rename from plugins/modules/foreman_auth_source_ldap.py rename to plugins/modules/auth_source_ldap.py index 4bfdd4ff..8c2d2215 100644 --- a/plugins/modules/foreman_auth_source_ldap.py +++ b/plugins/modules/auth_source_ldap.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_auth_source_ldap -short_description: Manage Foreman LDAP authentication sources using Foreman API +module: auth_source_ldap +short_description: Manage LDAP authentication sources description: - - Create and Delete Foreman LDAP authentication sources using Foreman API + - Create, update, and delete LDAP authentication sources author: - "Christoffer Reijer (@ephracis) Basalt AB" options: @@ -118,14 +118,14 @@ required: false type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: LDAP Authentication source - foreman_auth_source_ldap: + auth_source_ldap: name: "Example LDAP" host: "ldap.example.org" server_url: "https://foreman.example.com" @@ -138,7 +138,7 @@ state: present - name: LDAP Authentication with automatic registration - foreman_auth_source_ldap: + auth_source_ldap: name: "Example LDAP" host: "ldap.example.org" onthefly_register: True @@ -160,7 +160,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule class ForemanAuthSourceLdapModule(ForemanTaxonomicEntityAnsibleModule): diff --git a/plugins/modules/foreman_bookmark.py b/plugins/modules/bookmark.py similarity index 91% rename from plugins/modules/foreman_bookmark.py rename to plugins/modules/bookmark.py index 18122e83..659de6d4 100644 --- a/plugins/modules/foreman_bookmark.py +++ b/plugins/modules/bookmark.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_bookmark -short_description: Manage Foreman Bookmarks +module: bookmark +short_description: Manage Bookmarks description: - - "Manage Foreman Bookmark Entities" + - "Manage Bookmark Entities" author: - "Bernhard Hopfenmueller (@Fobhep) ATIX AG" - "Christoffer Reijer (@ephracis) Basalt AB" @@ -54,13 +54,13 @@ - Query of the bookmark type: str extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults ''' EXAMPLES = ''' - name: "Create a Bookmark" - foreman_bookmark: + bookmark: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -70,7 +70,7 @@ state: present_with_defaults - name: "Update a Bookmark" - foreman_bookmark: + bookmark: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -80,7 +80,7 @@ state: present - name: "Delete a Bookmark" - foreman_bookmark: + bookmark: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -91,7 +91,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanBookmarkModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_compute_attribute.py b/plugins/modules/compute_attribute.py similarity index 90% rename from plugins/modules/foreman_compute_attribute.py rename to plugins/modules/compute_attribute.py index fd77c8d8..da42f313 100644 --- a/plugins/modules/foreman_compute_attribute.py +++ b/plugins/modules/compute_attribute.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_compute_attribute -short_description: Manage Foreman Compute Attributes +module: compute_attribute +short_description: Manage Compute Attributes description: - - "Manage Foreman Compute Attributes" + - "Manage Compute Attributes" - "This beta version can create, and update compute attributes" author: - "Manisha Singhal (@Manisha15) ATIX AG" @@ -51,13 +51,13 @@ - vm_attributes type: dict extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: "Create compute attribute" - foreman_compute_attribute: + compute_attribute: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -69,7 +69,7 @@ state: present - name: "Update compute attribute" - foreman_compute_attribute: + compute_attribute: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -83,7 +83,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanComputeAttributeModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_compute_profile.py b/plugins/modules/compute_profile.py similarity index 93% rename from plugins/modules/foreman_compute_profile.py rename to plugins/modules/compute_profile.py index bc7145ad..49ae1043 100644 --- a/plugins/modules/foreman_compute_profile.py +++ b/plugins/modules/compute_profile.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: foreman_compute_profile -short_description: Manage Foreman Compute Profiles using Foreman API +module: compute_profile +short_description: Manage Compute Profiles description: - - Create and delete Foreman Compute Profiles using Foreman API + - Create, update, and delete Compute Profiles author: - "Philipp Joos (@philippj)" - "Baptiste Agasse (@bagasse)" @@ -59,13 +59,13 @@ - vm_attributes type: dict extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: compute profile - foreman_compute_profile: + compute_profile: name: example_compute_profile server_url: "https://foreman.example.com" username: admin @@ -73,7 +73,7 @@ state: present - name: another compute profile - foreman_compute_profile: + compute_profile: name: another_example_compute_profile compute_attributes: - compute_resource: ovirt_compute_resource1 @@ -87,7 +87,7 @@ state: present - name: compute profile2 - foreman_compute_profile: + compute_profile: name: example_compute_profile2 compute_attributes: - compute_resource: ovirt_compute_resource01 @@ -131,7 +131,7 @@ state: present - name: Remove compute profile - foreman_compute_profile: + compute_profile: name: example_compute_profile2 server_url: "https://foreman.example.com" username: admin @@ -141,7 +141,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule compute_attribute_foreman_spec = { diff --git a/plugins/modules/foreman_compute_resource.py b/plugins/modules/compute_resource.py similarity index 94% rename from plugins/modules/foreman_compute_resource.py rename to plugins/modules/compute_resource.py index 0eaa63f0..b911e522 100644 --- a/plugins/modules/foreman_compute_resource.py +++ b/plugins/modules/compute_resource.py @@ -27,10 +27,10 @@ DOCUMENTATION = ''' --- -module: foreman_compute_resource -short_description: Manage Foreman Compute resources using Foreman API +module: compute_resource +short_description: Manage Compute resources description: - - Create, update and delete Foreman Compute Resources using Foreman API + - Create, update, and delete Compute Resources author: - "Philipp Joos (@philippj)" - "Baptiste Agasse (@bagasse)" @@ -120,19 +120,19 @@ - verify ssl from provider I(provider=proxmox) type: bool extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: Create livirt compute resource - foreman_compute_resource: + compute_resource: name: example_compute_resource locations: - Munich organizations: - - ATIX + - ACME provider: libvirt provider_params: url: libvirt.example.com @@ -143,13 +143,13 @@ state: present - name: Update libvirt compute resource - foreman_compute_resource: + compute_resource: name: example_compute_resource description: updated compute resource locations: - Munich organizations: - - ATIX + - ACME provider: libvirt provider_params: url: libvirt.example.com @@ -160,7 +160,7 @@ state: present - name: Delete libvirt compute resource - foreman_compute_resource: + compute_resource: name: example_compute_resource server_url: "https://foreman.example.com" username: admin @@ -168,12 +168,12 @@ state: absent - name: Create vmware compute resource - foreman_compute_resource: + compute_resource: name: example_compute_resource locations: - Munich organizations: - - ATIX + - ACME provider: vmware provider_params: url: vsphere.example.com @@ -186,7 +186,7 @@ state: present - name: Create ovirt compute resource - foreman_compute_resource: + compute_resource: name: ovirt_compute_resource locations: - France/Toulouse @@ -206,12 +206,12 @@ state: present - name: Create proxmox compute resource - foreman_compute_resource: + compute_resource: name: proxmox_compute_resource locations: - Munich organizations: - - ATIX + - ACME provider: proxmox provider_params: url: https://proxmox.example.com:8006/api2/json @@ -224,13 +224,13 @@ state: present - name: create EC2 compute resource - foreman_compute_resource: + compute_resource: name: EC2_compute_resource description: EC2 locations: - AWS organizations: - - ATIX + - ACME provider: EC2 provider_params: user: AWS_ACCESS_KEY @@ -242,13 +242,13 @@ state: present - name: create Azure compute resource - foreman_compute_resource: + compute_resource: name: AzureRm_compute_resource description: AzureRm locations: - Azure organizations: - - ATIX + - ACME provider: AzureRm provider_params: user: SUBSCRIPTION_ID @@ -262,13 +262,13 @@ state: present - name: create GCE compute resource - foreman_compute_resource: + compute_resource: name: GCE compute resource description: Google Cloud Engine locations: - GCE organizations: - - ATIX + - ACME provider: GCE provider_params: project: orcharhino @@ -285,7 +285,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule def get_provider_info(provider): diff --git a/plugins/modules/foreman_config_group.py b/plugins/modules/config_group.py similarity index 86% rename from plugins/modules/foreman_config_group.py rename to plugins/modules/config_group.py index 20942d77..4580d416 100644 --- a/plugins/modules/foreman_config_group.py +++ b/plugins/modules/config_group.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_config_group -short_description: Manage (Puppet) config groups using Foreman API +module: config_group +short_description: Manage (Puppet) config groups description: - - Create and Delete Foreman (Puppet) config groups using Foreman API + - Create, update, and delete (Puppet) config groups author: - "Baptiste Agasse (@bagasse)" options: @@ -45,13 +45,13 @@ type: list elements: str extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: create new config group - foreman_config_group: + config_group: name: "My config group" puppetclasses: - ntp @@ -64,7 +64,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanConfigGroupModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/katello_content_credential.py b/plugins/modules/content_credential.py similarity index 85% rename from plugins/modules/katello_content_credential.py rename to plugins/modules/content_credential.py index 45aa23dc..4c7171fa 100644 --- a/plugins/modules/katello_content_credential.py +++ b/plugins/modules/content_credential.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: katello_content_credential -short_description: Create and Manage Katello content credentials +module: content_credential +short_description: Create and manage content credentials description: - - Create and Manage Katello content credentials + - Create and manage content credentials author: "Baptiste Agasse (@bagasse)" options: name: @@ -50,14 +50,14 @@ required: true type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Create katello client GPG key" - katello_content_credential: + content_credential: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -69,7 +69,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule class KatelloContentCredentialModule(KatelloEntityAnsibleModule): diff --git a/plugins/modules/katello_upload.py b/plugins/modules/content_upload.py similarity index 92% rename from plugins/modules/katello_upload.py rename to plugins/modules/content_upload.py index ea3e678c..3f18e12d 100644 --- a/plugins/modules/katello_upload.py +++ b/plugins/modules/content_upload.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: katello_upload -short_description: Upload content to Katello +module: content_upload +short_description: Upload content description: - - Allows the upload of content to a Katello repository + - Allows the upload of content to a repository author: "Eric D Helms (@ehelms)" requirements: - python-debian (For deb Package upload) @@ -56,13 +56,13 @@ - Currently only uploading to deb, RPM & file repositories is supported - For anything but file repositories, a supporting library must be installed. See Requirements. extends_documentation_fragment: - - foreman - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Upload my.rpm" - katello_upload: + content_upload: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -78,7 +78,7 @@ import traceback from ansible.module_utils._text import to_bytes -from ansible.module_utils.foreman_helper import KatelloAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloAnsibleModule, missing_required_lib try: from debian import debfile @@ -145,14 +145,14 @@ def main(): content_unit = None if module.foreman_params['repository']['content_type'] == 'deb': if not HAS_DEBFILE: - module.fail_json(msg='The python-debian module is required', exception=DEBFILE_IMP_ERR) + module.fail_json(msg=missing_required_lib("python-debian"), exception=DEBFILE_IMP_ERR) name, version, architecture = get_deb_info(b_src) query = 'name = "{0}" and version = "{1}" and architecture = "{2}"'.format(name, version, architecture) content_unit = module.find_resource('debs', query, params=repository_scope, failsafe=True) elif module.foreman_params['repository']['content_type'] == 'yum': if not HAS_RPM: - module.fail_json(msg='The rpm Python module is required', exception=RPM_IMP_ERR) + module.fail_json(msg=missing_required_lib("rpm"), exception=RPM_IMP_ERR) name, epoch, version, release, arch = get_rpm_info(b_src) query = 'name = "{0}" and epoch = "{1}" and version = "{2}" and release = "{3}" and arch = "{4}"'.format(name, epoch, version, release, arch) diff --git a/plugins/modules/katello_content_view.py b/plugins/modules/content_view.py similarity index 96% rename from plugins/modules/katello_content_view.py rename to plugins/modules/content_view.py index 09eb40a5..88349bbc 100644 --- a/plugins/modules/katello_content_view.py +++ b/plugins/modules/content_view.py @@ -25,15 +25,15 @@ DOCUMENTATION = ''' --- -module: katello_content_view -short_description: Create and Manage Katello content views +module: content_view +short_description: Create and manage content views description: - - Create and Manage Katello content views + - Create and manage content views author: "Eric D Helms (@ehelms)" options: name: description: - - Name of the Katello Content View + - Name of the Content View required: true type: str description: @@ -96,14 +96,14 @@ aliases: - version extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Create or update Fedora content view" - katello_content_view: + content_view: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -114,7 +114,7 @@ product: 'Fedora' - name: "Create a composite content view" - katello_content_view: + content_view: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -132,7 +132,7 @@ RETURN = ''' # ''' import copy -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule cvc_foreman_spec = { diff --git a/plugins/modules/katello_content_view_filter.py b/plugins/modules/content_view_filter.py similarity index 96% rename from plugins/modules/katello_content_view_filter.py rename to plugins/modules/content_view_filter.py index c4091ce6..519a3f42 100644 --- a/plugins/modules/katello_content_view_filter.py +++ b/plugins/modules/content_view_filter.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: katello_content_view_filter -short_description: Create and Manage Katello content View filters +module: content_view_filter +short_description: Create and manage content View filters description: - - Create and Manage Katello content View filters + - Create and manage content View filters author: "Sean O'Keeffe (@sean797)" options: architecture: @@ -140,13 +140,13 @@ - Include all RPMs with no errata type: bool extends_documentation_fragment: - - foreman - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: Exclude csh - katello_content_view_filter: + content_view_filter: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -157,7 +157,7 @@ package_name: tcsh - name: Include newer csh versions - katello_content_view_filter: + content_view_filter: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -172,7 +172,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloAnsibleModule, _foreman_spec_helper +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloAnsibleModule, _foreman_spec_helper content_filter_spec = { 'id': {}, diff --git a/plugins/modules/katello_content_view_version.py b/plugins/modules/content_view_version.py similarity index 94% rename from plugins/modules/katello_content_view_version.py rename to plugins/modules/content_view_version.py index 2b53ce58..16a26302 100644 --- a/plugins/modules/katello_content_view_version.py +++ b/plugins/modules/content_view_version.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: katello_content_view_version -short_description: Create, remove or interact with a Katello Content View Version +module: content_view_version +short_description: Create, remove or interact with a Content View Version description: - - Publish, Promote or Remove a Katello Content View Version + - Publish, Promote or Remove a Content View Version author: Sean O'Keeffe (@sean797) notes: - You cannot use this to remove a Content View Version from a Lifecycle environment, you should promote another version first. @@ -70,14 +70,14 @@ - Helpful for promoting a content view version type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Ensure content view version 2.0 is in Test & Pre Prod" - katello_content_view_version: + content_view_version: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -89,7 +89,7 @@ - Pre Prod - name: "Ensure content view version in Test is also in Pre Prod" - katello_content_view_version: + content_view_version: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -100,7 +100,7 @@ - Pre Prod - name: "Publish a content view, not idempotent" - katello_content_view_version: + content_view_version: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -108,7 +108,7 @@ organization: "Default Organization" - name: "Publish a content view and promote that version to Library & Dev, not idempotent" - katello_content_view_version: + content_view_version: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -119,7 +119,7 @@ - Dev - name: "Ensure content view version 1.0 doesn't exist" - katello_content_view_version: + content_view_version: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -132,7 +132,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule def promote_content_view_version(module, content_view_version, environments, force, force_yum_metadata_regeneration): diff --git a/plugins/modules/foreman_domain.py b/plugins/modules/domain.py similarity index 85% rename from plugins/modules/foreman_domain.py rename to plugins/modules/domain.py index 2ce5d9f6..896417f3 100644 --- a/plugins/modules/foreman_domain.py +++ b/plugins/modules/domain.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_domain -short_description: Manage Foreman Domains using Foreman API +module: domain +short_description: Manage Domains description: - - Create and Delete Foreman Domains using Foreman API + - Create, update, and delete Domains author: - "Markus Bucher (@m-bucher) ATIX AG" options: @@ -55,21 +55,21 @@ description: - Domain specific host parameters extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy - - foreman.nested_parameters + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy + - redhat.satellite.foreman.nested_parameters ''' EXAMPLES = ''' - name: domain - foreman_domain: + domain: name: "example.org" description: "Example Domain" locations: - "Munich" organizations: - - "ATIX" + - "ACME" server_url: "https://foreman.example.com" username: "admin" password: "secret" @@ -78,7 +78,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule, NestedParametersMixin +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule, NestedParametersMixin class ForemanDomainModule(NestedParametersMixin, ForemanTaxonomicEntityAnsibleModule): diff --git a/plugins/modules/foreman_external_usergroup.py b/plugins/modules/external_usergroup.py similarity index 89% rename from plugins/modules/foreman_external_usergroup.py rename to plugins/modules/external_usergroup.py index a6b8fd46..2b83fc59 100644 --- a/plugins/modules/foreman_external_usergroup.py +++ b/plugins/modules/external_usergroup.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_external_usergroup -short_description: Manage external user groups in Foreman +module: external_usergroup +short_description: Manage external user groups description: - - Create and delete external user groups in Foreman + - Create, update, and delete external user groups author: - "Kirill Shirinkin (@Fodoj)" options: @@ -48,13 +48,13 @@ required: true type: str extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: Create an external user group - foreman_external_usergroup: + external_usergroup: name: test auth_source_ldap: "My LDAP server" usergroup: "Internal Usergroup" @@ -63,7 +63,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanExternalUsergroupModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_global_parameter.py b/plugins/modules/global_parameter.py similarity index 90% rename from plugins/modules/foreman_global_parameter.py rename to plugins/modules/global_parameter.py index af7b43c5..4317525b 100644 --- a/plugins/modules/foreman_global_parameter.py +++ b/plugins/modules/global_parameter.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: foreman_global_parameter -short_description: Manage Foreman Global Parameters +module: global_parameter +short_description: Manage Global Parameters description: - - "Manage Foreman Global Parameter Entities" + - "Manage Global Parameter Entities" author: - "Bernhard Hopfenmueller (@Fobhep) ATIX AG" - "Matthias Dellweg (@mdellweg) ATIX AG" @@ -66,13 +66,13 @@ notes: - The I(parameter_type) only has an effect on Foreman >= 1.22 extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults ''' EXAMPLES = ''' - name: "Create a Global Parameter" - foreman_global_parameter: + global_parameter: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -81,7 +81,7 @@ state: present_with_defaults - name: "Update a Global Parameter" - foreman_global_parameter: + global_parameter: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -90,7 +90,7 @@ state: present - name: "Delete a Global Parameter" - foreman_global_parameter: + global_parameter: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -101,7 +101,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule, parameter_value_to_str +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule, parameter_value_to_str class ForemanCommonParameterModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_model.py b/plugins/modules/hardware_model.py similarity index 87% rename from plugins/modules/foreman_model.py rename to plugins/modules/hardware_model.py index 5dba6b74..c0058764 100644 --- a/plugins/modules/foreman_model.py +++ b/plugins/modules/hardware_model.py @@ -25,16 +25,16 @@ DOCUMENTATION = ''' --- -module: foreman_model -short_description: Manage Foreman hardware models +module: hardware_model +short_description: Manage hardware models description: - - Manage Foreman hardware models + - Manage hardware models author: - "Evgeni Golov (@evgeni)" options: name: description: - - Name of the Foreman hardware model + - Name of the hardware model required: true type: str info: @@ -52,13 +52,13 @@ - This is primarily used by Sparc Solaris builds and can be left blank for other architectures. type: str extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: "Create ACME Laptop model" - foreman_model: + hardware_model: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -70,7 +70,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanModelModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_host.py b/plugins/modules/host.py similarity index 94% rename from plugins/modules/foreman_host.py rename to plugins/modules/host.py index 71c878b8..50e1c3a1 100644 --- a/plugins/modules/foreman_host.py +++ b/plugins/modules/host.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_host -short_description: Manage Foreman hosts +module: host +short_description: Manage hosts description: - - "Manage Foreman host Entities" + - "Manage host Entities" - "This beta version can create and delete hosts from preexisting host groups" author: - "Bernhard Hopfenmueller (@Fobhep) ATIX AG" @@ -60,7 +60,7 @@ required: false enabled: description: - - Include this host within Foreman reporting + - Include this host within reporting type: bool required: false managed: @@ -114,15 +114,15 @@ type: str required: false extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.host_options - - foreman.nested_parameters + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.host_options + - redhat.satellite.foreman.nested_parameters ''' EXAMPLES = ''' - name: "Create a host" - foreman_host: + host: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -131,7 +131,7 @@ state: present - name: "Create a host with build context" - foreman_host: + host: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -141,7 +141,7 @@ state: present - name: "Create an unmanaged host" - foreman_host: + host: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -150,7 +150,7 @@ state: present - name: "Delete a host" - foreman_host: + host: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -160,7 +160,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ensure_puppetclasses, ForemanEntityAnsibleModule, HostMixin, diff --git a/plugins/modules/katello_host_collection.py b/plugins/modules/host_collection.py similarity index 89% rename from plugins/modules/katello_host_collection.py rename to plugins/modules/host_collection.py index 6f421907..3ac9689d 100644 --- a/plugins/modules/katello_host_collection.py +++ b/plugins/modules/host_collection.py @@ -25,7 +25,7 @@ DOCUMENTATION = ''' --- -module: katello_host_collection +module: host_collection short_description: Create and Manage host collections description: - Create and Manage host collections @@ -48,14 +48,14 @@ - New name of the host collection. When this parameter is set, the module will not be idempotent. type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Create Foo host collection" - katello_host_collection: + host_collection: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -67,7 +67,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule class KatelloHostCollectionModule(KatelloEntityAnsibleModule): diff --git a/plugins/modules/foreman_host_power.py b/plugins/modules/host_power.py similarity index 93% rename from plugins/modules/foreman_host_power.py rename to plugins/modules/host_power.py index 00bc9656..f43bbc39 100644 --- a/plugins/modules/foreman_host_power.py +++ b/plugins/modules/host_power.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_host_power -short_description: Manage Foreman hosts power state +module: host_power +short_description: Manage hosts power state description: - - "Manage power state of Foreman host" + - "Manage power state of a host" - "This beta version can start and stop an existing foreman host and question the current power state." author: - "Bernhard Hopfenmueller (@Fobhep) ATIX AG" @@ -56,12 +56,12 @@ - 'status' type: str extends_documentation_fragment: - - foreman + - redhat.satellite.foreman ''' EXAMPLES = ''' - name: "Switch a host on" - foreman_host_power: + host_power: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -69,7 +69,7 @@ state: on - name: "Switch a host off" - foreman_host_power: + host_power: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -77,7 +77,7 @@ state: off - name: "Query host power state" - foreman_host_power: + host_power: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -98,7 +98,7 @@ sample: "off" ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule def main(): diff --git a/plugins/modules/foreman_hostgroup.py b/plugins/modules/hostgroup.py similarity index 86% rename from plugins/modules/foreman_hostgroup.py rename to plugins/modules/hostgroup.py index f9ac421f..56dbc1ac 100644 --- a/plugins/modules/foreman_hostgroup.py +++ b/plugins/modules/hostgroup.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_hostgroup -short_description: Manage Foreman Hostgroups using Foreman API +module: hostgroup +short_description: Manage Hostgroups description: - - Create, Update and Delete Foreman Hostgroups using Foreman API + - Create, update, and delete Hostgroups author: - "Manisha Singhal (@Manisha15) ATIX AG" - "Baptiste Agasse (@bagasse)" @@ -59,16 +59,16 @@ description: - Hostgroup specific host parameters extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy - - foreman.nested_parameters - - foreman.host_options + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy + - redhat.satellite.foreman.nested_parameters + - redhat.satellite.foreman.host_options ''' EXAMPLES = ''' - name: "Create a Hostgroup" - foreman_hostgroup: + hostgroup: name: "new_hostgroup" architecture: "architecture_name" operatingsystem: "operatingsystem_name" @@ -80,7 +80,7 @@ state: present - name: "Update a Hostgroup" - foreman_hostgroup: + hostgroup: name: "new_hostgroup" architecture: "updated_architecture_name" operatingsystem: "updated_operatingsystem_name" @@ -100,12 +100,12 @@ state: present - name: "My nested hostgroup" - foreman_hostgroup: + hostgroup: parent: "new_hostgroup" name: "my nested hostgroup" - name: "My hostgroup with some proxies" - foreman_hostgroup: + hostgroup: name: "my hostgroup" environment: production puppet_proxy: puppet-proxy.example.com @@ -113,7 +113,7 @@ openscap_proxy: openscap-proxy.example.com - name: "My katello related hostgroup" - foreman_hostgroup: + hostgroup: organization: "My Org" name: "kt hostgroup" content_source: capsule.example.com @@ -124,7 +124,7 @@ value: "my_prod_ak" - name: "Delete a Hostgroup" - foreman_hostgroup: + hostgroup: name: "new_hostgroup" server_url: "https://foreman.example.com" username: "admin" @@ -134,7 +134,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ensure_puppetclasses, HostMixin, ForemanTaxonomicEntityAnsibleModule, @@ -156,14 +156,14 @@ def main(): argument_spec=dict( updated_name=dict(), ), + required_by=dict( + content_source=('organization',), + content_view=('organization',), + lifecycle_environment=('organization',), + ), ) module_params = module.foreman_params - katello_params = ['content_source', 'lifecycle_environment', 'content_view'] - - if 'organization' not in module_params and list(set(katello_params) & set(module_params.keys())): - module.fail_json(msg="Please specify the organization when using katello parameters.") - with module.api_connection(): if not module.desired_absent: if 'organization' in module_params: diff --git a/plugins/modules/foreman_image.py b/plugins/modules/image.py similarity index 93% rename from plugins/modules/foreman_image.py rename to plugins/modules/image.py index 488ddd26..d3637567 100644 --- a/plugins/modules/foreman_image.py +++ b/plugins/modules/image.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_image -short_description: Manage Foreman Images using Foreman API +module: image +short_description: Manage Images description: - - Create and Delete Foreman Images using Foreman API + - Create, update, and delete Images author: - "Mark Hlawatschek (@hlawatschek) ATIX AG" options: @@ -67,13 +67,13 @@ required: false type: bool extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: create Image for EC2 - foreman_image: + image: name: CentOS image_uuid: "ami-0ff760d16d9497662" image_username: "centos" @@ -84,7 +84,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanImageModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_installation_medium.py b/plugins/modules/installation_medium.py similarity index 89% rename from plugins/modules/foreman_installation_medium.py rename to plugins/modules/installation_medium.py index 08993ac0..182eea3d 100644 --- a/plugins/modules/foreman_installation_medium.py +++ b/plugins/modules/installation_medium.py @@ -25,18 +25,17 @@ DOCUMENTATION = ''' --- -module: foreman_installation_medium -short_description: Manage Foreman Installation Medium using Foreman API +module: installation_medium +short_description: Manage Installation Medium description: - - Create and Delete Foreman Installation Medium using Foreman API + - Create, update, and delete Installation Medium author: - "Manuel Bonk(@manuelbonk) ATIX AG" options: name: description: - - | - The full installation medium name. - The special name "*" (only possible as parameter) is used to perform bulk actions (modify, delete) on all existing partition tables. + - The full installation medium name. + - The special name "*" (only possible as parameter) is used to perform bulk actions (modify, delete) on all existing partition tables. required: true type: str updated_name: @@ -55,20 +54,20 @@ description: Path to the installation medium type: str extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.taxonomy - - foreman.os_family + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.taxonomy + - redhat.satellite.foreman.os_family ''' EXAMPLES = ''' - name: create new debian medium - foreman_installation_medium: + installation_medium: name: "wheezy" locations: - "Munich" organizations: - - "ATIX" + - "ACME" operatingsystems: - "Debian" path: "http://debian.org/mirror/" @@ -80,7 +79,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule, OS_LIST +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule, OS_LIST class ForemanInstallationMediumModule(ForemanTaxonomicEntityAnsibleModule): diff --git a/plugins/modules/foreman_job_template.py b/plugins/modules/job_template.py similarity index 91% rename from plugins/modules/foreman_job_template.py rename to plugins/modules/job_template.py index f4b656bc..e17e826d 100644 --- a/plugins/modules/foreman_job_template.py +++ b/plugins/modules/job_template.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_job_template -short_description: Manage Job Templates in Foreman +module: job_template +short_description: Manage Job Templates description: - - "Manage Foreman Remote Execution Job Templates" + - "Manage Remote Execution Job Templates" author: - "Manuel Bonk (@manuelbonk) ATIX AG" - "Matthias Dellweg (@mdellweg) ATIX AG" @@ -43,10 +43,8 @@ type: str file_name: description: - - | - The path of a template file, that shall be imported. - Either this or layout is required as a source for - the Job Template "content". + - The path of a template file, that shall be imported. + - Either this or I(template) is required as a source for the Job Template "content". type: path job_category: description: @@ -59,14 +57,9 @@ type: bool name: description: - - | - The name a template should be assigned with in Foreman. - name must be provided. - Possible sources are, ordererd by preference: - The "name" parameter, config header (inline or in a file), - basename of a file. - The special name "*" (only possible as parameter) is used - to perform bulk actions (modify, delete) on all existing Job Templates. + - The name of the Job Template. + - If omited, will be determined from the C(name) header of the template or the filename (in that order). + - The special value "*" can be used to perform bulk actions (modify, delete) on all existing templates. type: str provider_type: description: @@ -80,9 +73,8 @@ type: bool template: description: - - | - The content of the Job Template, either this or file_name - is required as a source for the Job Template "content". + - The content of the Job Template. + - Either this or I(file_name) is required as a source for the Job Template "content". type: str template_inputs: description: @@ -152,15 +144,15 @@ - Type of the resource type: str extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: "Create a Job Template inline" - foreman_job_template: + job_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -180,7 +172,7 @@ - TARDIS INC - name: "Create a Job Template from a file" - foreman_job_template: + job_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -196,7 +188,7 @@ - TARDIS INC - name: "remove a job template's template inputs" - foreman_job_template: + job_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -209,7 +201,7 @@ - TARDIS INC - name: "Delete a Job Template" - foreman_job_template: + job_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -217,7 +209,7 @@ state: absent - name: "Create a Job Template from a file and modify with parameter(s)" - foreman_job_template: + job_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -232,7 +224,7 @@ # Providing a name in this case wouldn't be very sensible. # Alternatively make use of with_filetree to parse recursively with filter. - name: Parsing a directory of Job templates - foreman_job_template: + job_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -247,12 +239,12 @@ # If the templates are stored locally and the ansible module is executed on a remote host - name: Ensure latest version of all your Job Templates - foreman_job_template: + job_template: server_url: "https://foreman.example.com" username: "admin" password: "changeme" state: present - layout: '{{ lookup("file", item.src) }}' + template: '{{ lookup("file", item.src) }}' with_filetree: '/path/to/job/templates' when: item.state == 'file' @@ -285,7 +277,7 @@ RETURN = ''' # ''' import os -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ForemanTaxonomicEntityAnsibleModule, parse_template, parse_template_from_file, diff --git a/plugins/modules/katello_lifecycle_environment.py b/plugins/modules/lifecycle_environment.py similarity index 88% rename from plugins/modules/katello_lifecycle_environment.py rename to plugins/modules/lifecycle_environment.py index 25484fb0..3af0de4f 100644 --- a/plugins/modules/katello_lifecycle_environment.py +++ b/plugins/modules/lifecycle_environment.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: katello_lifecycle_environment -short_description: Create and Manage Katello lifecycle environments +module: lifecycle_environment +short_description: Create and manage lifecycle environments description: - - Create and Manage Katello lifecycle environments + - Create and manage lifecycle environments author: - "Andrew Kofink (@akofink)" - "Baptiste Agasse (@bagasse)" @@ -52,14 +52,14 @@ - Name of the parent lifecycle environment type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Add a production lifecycle environment" - katello_lifecycle_environment: + lifecycle_environment: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -73,7 +73,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule class KatelloLifecycleEnvironmentModule(KatelloEntityAnsibleModule): diff --git a/plugins/modules/foreman_location.py b/plugins/modules/location.py similarity index 87% rename from plugins/modules/foreman_location.py rename to plugins/modules/location.py index e9e21766..0b5928a1 100644 --- a/plugins/modules/foreman_location.py +++ b/plugins/modules/location.py @@ -25,16 +25,16 @@ DOCUMENTATION = ''' --- -module: foreman_location -short_description: Manage Foreman Location +module: location +short_description: Manage Location description: - - Manage Foreman Location + - Manage Location author: - "Matthias M Dellweg (@mdellweg) ATIX AG" options: name: description: - - Name or Title of the Foreman Location + - Name of the Location required: true type: str parent: @@ -47,15 +47,15 @@ type: list elements: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.nested_parameters + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.nested_parameters ''' EXAMPLES = ''' # Create a simple location - name: "Create CI Location" - foreman_location: + location: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -66,7 +66,7 @@ # Create a nested location - name: "Create Nested CI Location" - foreman_location: + location: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -76,7 +76,7 @@ # Create a new nested location with parent included in name - name: "Create New Nested Location" - foreman_location: + location: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -85,7 +85,7 @@ # Move a nested location to another parent - name: "Create Nested CI Location" - foreman_location: + location: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -96,7 +96,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule, NestedParametersMixin +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule, NestedParametersMixin class ForemanLocationModule(NestedParametersMixin, ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_operatingsystem.py b/plugins/modules/operatingsystem.py similarity index 94% rename from plugins/modules/foreman_operatingsystem.py rename to plugins/modules/operatingsystem.py index 71f7c003..e4117bbd 100644 --- a/plugins/modules/foreman_operatingsystem.py +++ b/plugins/modules/operatingsystem.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: foreman_operatingsystem -short_description: Manage Foreman Operating Systems +module: operatingsystem +short_description: Manage Operating Systems description: - - "Manage Foreman Operating System Entities" + - "Manage Operating System Entities" author: - "Matthias M Dellweg (@mdellweg) ATIX AG" - "Bernhard HopfenmĂ¼ller (@Fobhep) ATIX AG" @@ -109,15 +109,15 @@ description: - Operating System specific host parameters extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.nested_parameters - - foreman.os_family + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.nested_parameters + - redhat.satellite.foreman.os_family ''' EXAMPLES = ''' - name: "Create an Operating System" - foreman_operatingsystem: + operatingsystem: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -131,7 +131,7 @@ state: present - name: "Ensure existence of an Operating System (provide default values)" - foreman_operatingsystem: + operatingsystem: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -142,7 +142,7 @@ state: present_with_defaults - name: "Delete an Operating System" - foreman_operatingsystem: + operatingsystem: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -155,7 +155,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ForemanEntityAnsibleModule, NestedParametersMixin, OS_LIST, diff --git a/plugins/modules/foreman_organization.py b/plugins/modules/organization.py similarity index 80% rename from plugins/modules/foreman_organization.py rename to plugins/modules/organization.py index f8962da4..81fea610 100644 --- a/plugins/modules/foreman_organization.py +++ b/plugins/modules/organization.py @@ -26,37 +26,37 @@ DOCUMENTATION = ''' --- -module: foreman_organization -short_description: Manage Foreman Organization +module: organization +short_description: Manage Organization description: - - Manage Foreman Organization + - Manage Organization author: - "Eric D Helms (@ehelms)" - "Matthias M Dellweg (@mdellweg) ATIX AG" options: name: description: - - Name of the Foreman organization + - Name of the Organization required: true type: str description: description: - - Description of the Foreman organization + - Description of the Organization required: false type: str label: description: - - Label of the Foreman organization + - Label of the Organization type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.nested_parameters + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.nested_parameters ''' EXAMPLES = ''' - name: "Create CI Organization" - foreman_organization: + organization: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -67,7 +67,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule, NestedParametersMixin +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule, NestedParametersMixin class ForemanOrganizationModule(NestedParametersMixin, ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_os_default_template.py b/plugins/modules/os_default_template.py similarity index 90% rename from plugins/modules/foreman_os_default_template.py rename to plugins/modules/os_default_template.py index f7d78e51..31ae97e1 100644 --- a/plugins/modules/foreman_os_default_template.py +++ b/plugins/modules/os_default_template.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_os_default_template -short_description: Manage Foreman Default Template Associations To Operating Systems +module: os_default_template +short_description: Manage Default Template Associations To Operating Systems description: - - "Manage Foreman OSDefaultTemplate Entities" + - "Manage OSDefaultTemplate Entities" author: - "Matthias M Dellweg (@mdellweg) ATIX AG" options: @@ -48,13 +48,13 @@ required: false type: str extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults ''' EXAMPLES = ''' - name: "Create an Association" - foreman_os_default_template: + os_default_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -64,7 +64,7 @@ state: present - name: "Delete an Association" - foreman_os_default_template: + os_default_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -76,7 +76,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanOsDefaultTemplateModule(ForemanEntityAnsibleModule): diff --git a/plugins/modules/foreman_ptable.py b/plugins/modules/partition_table.py similarity index 88% rename from plugins/modules/foreman_ptable.py rename to plugins/modules/partition_table.py index 51b87981..77e8261e 100644 --- a/plugins/modules/foreman_ptable.py +++ b/plugins/modules/partition_table.py @@ -25,27 +25,24 @@ DOCUMENTATION = ''' --- -module: foreman_ptable -short_description: Manage Partition Table Template in Foreman +module: partition_table +short_description: Manage Partition Table Template description: - - "Manage Foreman Partition Table" + - "Manage Partition Table" author: - "Bernhard Hopfenmueller (@Fobhep) ATIX AG" - "Matthias Dellweg (@mdellweg) ATIX AG" options: file_name: description: - - | - The path of a template file, that shall be imported. - Either this or layout is required as a source for - the Partition Template "content". + - The path of a template file, that shall be imported. + - Either this or I(layout) is required as a source for the Partition Template "content". required: false type: path layout: description: - - | - The content of the Partitioning Table Template, either this or file_name - is required as a source for the Partition Template "content". + - The content of the Partitioning Table Template + - Either this or I(file_name) is required as a source for the Partition Template "content". required: false type: str locked: @@ -55,14 +52,9 @@ type: bool name: description: - - | - The name a template should be assigned with in Foreman. - A name must be provided. - Possible sources are, ordererd by preference: - The "name" parameter, config header (inline or in a file), - basename of a file. - The special name "*" (only possible as parameter) is used - to perform bulk actions (modify, delete) on all existing partition tables. + - The name of the Partition Table. + - If omited, will be determined from the C(name) header of the template or the filename (in that order). + - The special value "*" can be used to perform bulk actions (modify, delete) on all existing Partition Tables. required: false type: str updated_name: @@ -73,17 +65,17 @@ description: - The OS family the template shall be assigned with. extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.taxonomy - - foreman.os_family + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.taxonomy + - redhat.satellite.foreman.os_family ''' EXAMPLES = ''' # Keep in mind, that in this case, the inline parameters will be overwritten - name: "Create a Partition Table inline" - foreman_ptable: + partition_table: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -102,7 +94,7 @@ - TARDIS INC - name: "Create a Partition Template from a file" - foreman_ptable: + partition_table: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -114,7 +106,7 @@ - TARDIS INC - name: "Delete a Partition Template" - foreman_ptable: + partition_table: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -126,7 +118,7 @@ state: absent - name: "Create a Partition Template from a file and modify with parameter(s)" - foreman_ptable: + partition_table: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -141,7 +133,7 @@ # Providing a name in this case wouldn't be very sensible. # Alternatively make use of with_filetree to parse recursively with filter. - name: "Parsing a directory of partition templates" - foreman_ptable: + partition_table: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -156,7 +148,7 @@ # If the templates are stored locally and the ansible module is executed on a remote host - name: Ensure latest version of all Ptable Community Templates - foreman_ptable: + partition_table: server_url: "https://foreman.example.com" username: "admin" password: "changeme" @@ -196,7 +188,7 @@ import os -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ForemanTaxonomicEntityAnsibleModule, parse_template, parse_template_from_file, diff --git a/plugins/modules/katello_product.py b/plugins/modules/product.py similarity index 90% rename from plugins/modules/katello_product.py rename to plugins/modules/product.py index c7dc0428..0dec814e 100644 --- a/plugins/modules/katello_product.py +++ b/plugins/modules/product.py @@ -25,17 +25,17 @@ DOCUMENTATION = ''' --- -module: katello_product -short_description: Create and Manage Katello products +module: product +short_description: Create and manage products description: - - Create and Manage Katello products + - Create and manage products author: - "Eric D Helms (@ehelms)" - "Matthias Dellweg (@mdellweg) ATIX AG" options: name: description: - - Name of the Katello product + - Name of the product required: true type: str label: @@ -74,14 +74,14 @@ required: false type: str extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Create Fedora product with a sync plan" - katello_product: + product: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -91,7 +91,7 @@ state: present - name: "Create CentOS 7 product with content credentials" - katello_product: + product: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -104,7 +104,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule class KatelloProductModule(KatelloEntityAnsibleModule): diff --git a/plugins/modules/foreman_provisioning_template.py b/plugins/modules/provisioning_template.py similarity index 89% rename from plugins/modules/foreman_provisioning_template.py rename to plugins/modules/provisioning_template.py index 41a6ff39..1cf427e2 100644 --- a/plugins/modules/foreman_provisioning_template.py +++ b/plugins/modules/provisioning_template.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_provisioning_template -short_description: Manage Provisioning Template in Foreman +module: provisioning_template +short_description: Manage Provisioning Template description: - - "Manage Foreman Provisioning Template" + - "Manage Provisioning Template" author: - "Bernhard Hopfenmueller (@Fobhep) ATIX AG" - "Matthias Dellweg (@mdellweg) ATIX AG" @@ -59,17 +59,14 @@ type: str template: description: - - | - The content of the provisioning template, either this or file_name - is required as a source for the Provisioning Template "content". + - The content of the provisioning template. + - Either this or I(file_name) is required as a source for the Provisioning Template "content". required: false type: str file_name: description: - - | - The path of a template file, that shall be imported. - Either this or template is required as a source for - the Provisioning Template "content". + - The path of a template file, that shall be imported. + - Either this or I(template) is required as a source for the Provisioning Template "content". required: false type: path locked: @@ -79,13 +76,9 @@ type: bool name: description: - - | - The name a template should be assigned with in Foreman. - A name must be provided. - Possible sources are, ordererd by preference: - The "name" parameter, config header (inline or in a file), basename of a file. - The special name "*" (only possible as parameter) is used - to perform bulk actions (modify, delete) on all existing templates. + - The name of the Provisioning Template. + - If omited, will be determined from the C(name) header of the template or the filename (in that order). + - The special value "*" can be used to perform bulk actions (modify, delete) on all existing templates. required: false type: str updated_name: @@ -97,16 +90,16 @@ type: list elements: str extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' # Keep in mind, that in this case, the inline parameters will be overwritten - name: "Create a Provisioning Template inline" - foreman_provisioning_template: + provisioning_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -126,7 +119,7 @@ - TARDIS INC - name: "Create a Provisioning Template from a file" - foreman_provisioning_template: + provisioning_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -140,7 +133,7 @@ # Due to the module logic, deleting requires a template dummy, # either inline or from a file. - name: "Delete a Provisioning Template" - foreman_provisioning_template: + provisioning_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -152,7 +145,7 @@ state: absent - name: "Create a Provisioning Template from a file and modify with parameter" - foreman_provisioning_template: + provisioning_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -167,7 +160,7 @@ # Providing a name in this case wouldn't be very sensible. # Alternatively make use of with_filetree to parse recursively with filter. - name: "Parsing a directory of provisioning templates" - foreman_provisioning_template: + provisioning_template: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -182,7 +175,7 @@ # If the templates are stored locally and the ansible module is executed on a remote host - name: Ensure latest version of all Provisioning Community Templates - foreman_provisioning_template: + provisioning_template: server_url: "https://foreman.example.com" username: "admin" password: "changeme" @@ -222,7 +215,7 @@ import os -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ForemanTaxonomicEntityAnsibleModule, parse_template, parse_template_from_file, diff --git a/plugins/modules/foreman_environment.py b/plugins/modules/puppet_environment.py similarity index 84% rename from plugins/modules/foreman_environment.py rename to plugins/modules/puppet_environment.py index a9c207f5..7e16f8a8 100644 --- a/plugins/modules/foreman_environment.py +++ b/plugins/modules/puppet_environment.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: foreman_environment -short_description: Manage Foreman Environment (Puppet) using Foreman API +module: puppet_environment +short_description: Manage Environment (Puppet) description: - - Create and Delete Foreman Environment using Foreman API + - Create, update, and delete Environment author: - "Bernhard Suttner (@_sbernhard) ATIX AG" - "Christoffer Reijer (@ephracis) Basalt AB" @@ -39,19 +39,19 @@ required: true type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: create new environment - foreman_environment: + puppet_environment: name: "testing" locations: - "Munich" organizations: - - "ATIX" + - "ACME" server_url: "https://foreman.example.com" username: "admin" password: "secret" @@ -60,7 +60,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ForemanTaxonomicEntityAnsibleModule, ) diff --git a/plugins/modules/foreman_realm.py b/plugins/modules/realm.py similarity index 87% rename from plugins/modules/foreman_realm.py rename to plugins/modules/realm.py index d9706cfe..a6c7eb32 100644 --- a/plugins/modules/foreman_realm.py +++ b/plugins/modules/realm.py @@ -25,16 +25,16 @@ DOCUMENTATION = ''' --- -module: foreman_realm -short_description: Manage Foreman Realms +module: realm +short_description: Manage Realms description: - - Manage Foreman Realms + - Manage Realms author: - "Lester R Claudio (@claudiol1)" options: name: description: - - Name of the Foreman realm + - Name of the realm required: true type: str realm_proxy: @@ -52,14 +52,14 @@ required: true type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: "Create EXAMPLE.LOCAL Realm" - foreman_realm: + realm: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -71,7 +71,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule class ForemanRealmModule(ForemanTaxonomicEntityAnsibleModule): diff --git a/plugins/modules/redhat_manifest.py b/plugins/modules/redhat_manifest.py index 193610ca..ae229c9a 100644 --- a/plugins/modules/redhat_manifest.py +++ b/plugins/modules/redhat_manifest.py @@ -42,12 +42,12 @@ type: str username: description: - - Username on Foreman server + - Red Hat Portal username required: true type: str password: description: - - Password for user accessing Foreman server + - Red Hat Portal password required: true type: str pool_id: diff --git a/plugins/modules/katello_repository.py b/plugins/modules/repository.py similarity index 95% rename from plugins/modules/katello_repository.py rename to plugins/modules/repository.py index 904efc2c..c59ae0ab 100644 --- a/plugins/modules/katello_repository.py +++ b/plugins/modules/repository.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: katello_repository -short_description: Create and manage Katello repository +module: repository +short_description: Create and manage repositories description: - - Crate and manage a Katello repository + - Crate and manage repositories author: "Eric D Helms (@ehelms)" options: name: @@ -161,14 +161,14 @@ type: str required: false extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Create repository" - katello_repository: + repository: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -182,7 +182,7 @@ download_policy: background - name: "Create repository with content credentials" - katello_repository: + repository: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -200,7 +200,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule class KatelloRepositoryModule(KatelloEntityAnsibleModule): diff --git a/plugins/modules/katello_repository_set.py b/plugins/modules/repository_set.py similarity index 95% rename from plugins/modules/katello_repository_set.py rename to plugins/modules/repository_set.py index a39300c1..5bc3bdf6 100644 --- a/plugins/modules/katello_repository_set.py +++ b/plugins/modules/repository_set.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: katello_repository_set -short_description: Enable/disable repositories in Katello repository sets +module: repository_set +short_description: Enable/disable repositories in repository sets description: - - Enable/disable repositories in Katello repository sets + - Enable/disable repositories in repository sets author: "Andrew Kofink (@akofink)" options: name: @@ -80,13 +80,13 @@ default: enabled type: str extends_documentation_fragment: - - foreman - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Enable RHEL 7 RPMs repositories" - katello_repository_set: + repository_set: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -105,7 +105,7 @@ state: enabled - name: "Enable RHEL 7 RPMs repositories with label" - katello_repository_set: + repository_set: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -123,7 +123,7 @@ state: enabled - name: "Disable RHEL 7 Extras RPMs repository" - katello_repository_set: + repository_set: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -135,7 +135,7 @@ - basearch: x86_64 - name: "Enable RHEL 8 BaseOS RPMs repository with label" - katello_repository_set: + repository_set: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -145,7 +145,7 @@ - releasever: "8" - name: "Enable Red Hat Virtualization Manager RPMs repository with label" - katello_repository_set: + repository_set: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -156,7 +156,7 @@ state: enabled - name: "Enable Red Hat Virtualization Manager RPMs repository without specifying basearch" - katello_repository_set: + repository_set: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -166,7 +166,7 @@ state: enabled - name: "Search for possible repository sets of a product" - foreman_search_facts: + resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -179,7 +179,7 @@ var: data - name: "Search for possible repository sets by label" - foreman_search_facts: + resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -194,7 +194,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule def get_desired_repos(desired_substitutions, available_repos): diff --git a/plugins/modules/katello_sync.py b/plugins/modules/repository_sync.py similarity index 66% rename from plugins/modules/katello_sync.py rename to plugins/modules/repository_sync.py index 3dbcee91..6965a8a5 100644 --- a/plugins/modules/katello_sync.py +++ b/plugins/modules/repository_sync.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: katello_sync -short_description: Sync a Katello repository or product +module: repository_sync +short_description: Sync a repository or product description: - - Sync a Katello repository or product + - Sync a repository or product author: - "Eric D Helms (@ehelms)" - "Matthias M Dellweg (@mdellweg) ATIX AG" @@ -44,60 +44,25 @@ If omitted, all repositories in I(product) are synched. type: str extends_documentation_fragment: - - foreman - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.organization ... ''' EXAMPLES = ''' - name: "Sync repository" - katello_sync: + repository_sync: username: "admin" password: "changeme" server_url: "https://foreman.example.com" repository: "My repository" product: "My Product" organization: "Default Organization" - -# Sync all repositories -- name: Get all repositories - foreman_search_facts: - username: "admin" - password: "changeme" - server_url: "https://foreman.example.com" - resource: repositories - register: repositories - -- name: Kick off repository Sync tasks - katello_sync: - username: "admin" - password: "changeme" - server_url: "https://foreman.example.com" - product: "{{ item.product.name }}" - repository: "{{ item.name }}" - organization: "Default Organization" - loop: "{{ repositories.resources }}" - when: item.url # Not all repositories have a URL - async: 999999 - poll: 0 - register: repo_sync_sleeper - -- name: Wait until all Syncs have finished - async_status: - jid: "{{ repo_sync_sleeper_item.ansible_job_id }}" - loop: "{{ repo_sync_sleeper.results }}" - loop_control: - loop_var: repo_sync_sleeper_item - when: repo_sync_sleeper_item.ansible_job_id is defined # Skip items that were skipped in the previous task - register: async_job_result - until: async_job_result.finished - retries: 999 - delay: 10 ''' RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloAnsibleModule def main(): diff --git a/plugins/modules/foreman_search_facts.py b/plugins/modules/resource_info.py similarity index 90% rename from plugins/modules/foreman_search_facts.py rename to plugins/modules/resource_info.py index 64955d25..543ad988 100644 --- a/plugins/modules/foreman_search_facts.py +++ b/plugins/modules/resource_info.py @@ -26,10 +26,10 @@ DOCUMENTATION = ''' --- -module: foreman_search_facts -short_description: Gather facts about Foreman resources +module: resource_info +short_description: Gather facts about resources description: - - "Gather facts about Foreman resources" + - "Gather facts about resources" author: - "Sean O'Keeffe (@sean797)" options: @@ -62,12 +62,12 @@ notes: - Some resources don't support scoping and will return errors when you pass I(organization) or unknown data in I(params). extends_documentation_fragment: - - foreman + - redhat.satellite.foreman ''' EXAMPLES = ''' - name: "Read a Setting" - foreman_search_facts: + resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -77,8 +77,8 @@ - debug: var: result.resources[0].value -- name: "Read all Registries (Katello)" - foreman_search_facts: +- name: "Read all Registries" + resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -89,7 +89,7 @@ with_items: "{{ result.resources }}" - name: "Read all Organizations with full details" - foreman_search_facts: + resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -99,8 +99,8 @@ - debug: var: result.resources -- name: Get all existing subscriptions for organization with id 1 (Katello) - foreman_search_facts: +- name: Get all existing subscriptions for organization with id 1 + resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -111,8 +111,8 @@ - debug: var: result -- name: Get all existing activation keys for organization ACME (Katello) - foreman_search_facts: +- name: Get all existing activation keys for organization ACME + resource_info: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -125,12 +125,12 @@ RETURN = ''' resources: - description: Search results from Foreman + description: Resource information returned: always type: list ''' -from ansible.module_utils.foreman_helper import ForemanAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanAnsibleModule def main(): diff --git a/plugins/modules/foreman_role.py b/plugins/modules/role.py similarity index 92% rename from plugins/modules/foreman_role.py rename to plugins/modules/role.py index 3d551a77..13f1e840 100644 --- a/plugins/modules/foreman_role.py +++ b/plugins/modules/role.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_role -short_description: Manage Foreman Roles using Foreman API +module: role +short_description: Manage Roles description: - - Create and Delete Foreman Roles using Foreman API + - Create, update, and delete Roles author: - "Christoffer Reijer (@ephracis) Basalt AB" options: @@ -56,20 +56,20 @@ required: false type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: role - foreman_role: + role: name: "Provisioner" description: "Only provision on libvirt" locations: - "Uppsala" organizations: - - "Basalt" + - "ACME" filters: - permissions: - view_hosts @@ -84,7 +84,7 @@ import copy -from ansible.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule filter_foreman_spec = dict( diff --git a/plugins/modules/foreman_scap_content.py b/plugins/modules/scap_content.py similarity index 87% rename from plugins/modules/foreman_scap_content.py rename to plugins/modules/scap_content.py index 5d4dc4b9..78a3a6d0 100644 --- a/plugins/modules/foreman_scap_content.py +++ b/plugins/modules/scap_content.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_scap_content -short_description: Manage Foreman SCAP content using Foreman API. +module: scap_content +short_description: Manage SCAP content. description: - - Create, Update and Delete Foreman SCAP content using Foreman API. + - Create, update, and delete SCAP content. author: - "Jameer Pathan (@jameerpathan111)" options: @@ -43,15 +43,15 @@ - When this parameter is set, the module will not be idempotent. type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy - - foreman.scap_datastream + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy + - redhat.satellite.foreman.scap_datastream ''' EXAMPLES = ''' - name: Create SCAP content - foreman_scap_content: + scap_content: title: "Red Hat firefox default content" scap_file: "/home/user/Downloads/ssg-firefox-ds.xml" original_filename: "ssg-firefox-ds.xml" @@ -65,7 +65,7 @@ state: present - name: Update SCAP content - foreman_scap_content: + scap_content: title: "Red Hat firefox default content" updated_title: "Updated scap content title" scap_file: "/home/user/Downloads/updated-ssg-firefox-ds.xml" @@ -82,7 +82,7 @@ state: present - name: Delete SCAP content - foreman_scap_content: + scap_content: title: "Red Hat firefox default content" server_url: "https://foreman.example.com" username: "admin" @@ -92,7 +92,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanScapDataStreamModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanScapDataStreamModule class ForemanScapContentModule(ForemanScapDataStreamModule): diff --git a/plugins/modules/foreman_scap_tailoring_file.py b/plugins/modules/scap_tailoring_file.py similarity index 86% rename from plugins/modules/foreman_scap_tailoring_file.py rename to plugins/modules/scap_tailoring_file.py index bec8dc9e..c5bdb9d0 100644 --- a/plugins/modules/foreman_scap_tailoring_file.py +++ b/plugins/modules/scap_tailoring_file.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_scap_tailoring_file -short_description: Manage Foreman SCAP tailoring files using Foreman API. +module: scap_tailoring_file +short_description: Manage SCAP tailoring files. description: - - Create, Update and Delete Foreman SCAP tailoring files using Foreman API. + - Create, update, and delete SCAP tailoring files. author: - "Evgeni Golov (@evgeni)" options: @@ -43,15 +43,15 @@ - When this parameter is set, the module will not be idempotent. type: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy - - foreman.scap_datastream + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy + - redhat.satellite.foreman.scap_datastream ''' EXAMPLES = ''' - name: Create SCAP tailoring file - foreman_scap_tailoring_file: + scap_tailoring_file: name: "Red Hat firefox default content" scap_file: "/home/user/Downloads/ssg-firefox-ds-tailoring.xml" original_filename: "ssg-firefox-ds-tailoring.xml" @@ -65,7 +65,7 @@ state: present - name: Update SCAP tailoring file - foreman_scap_tailoring_file: + scap_tailoring_file: name: "Red Hat firefox default content" updated_name: "Updated tailoring file name" scap_file: "/home/user/Downloads/updated-ssg-firefox-ds-tailoring.xml" @@ -82,7 +82,7 @@ state: present - name: Delete SCAP tailoring file - foreman_scap_tailoring_file: + scap_tailoring_file: name: "Red Hat firefox default content" server_url: "https://foreman.example.com" username: "admin" @@ -92,7 +92,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanScapDataStreamModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanScapDataStreamModule class ForemanTailoringFileModule(ForemanScapDataStreamModule): diff --git a/plugins/modules/foreman_setting.py b/plugins/modules/setting.py similarity index 91% rename from plugins/modules/foreman_setting.py rename to plugins/modules/setting.py index 8da1058e..945f06cc 100644 --- a/plugins/modules/foreman_setting.py +++ b/plugins/modules/setting.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_setting -short_description: Manage Foreman Settings +module: setting +short_description: Manage Settings description: - - "Manage Foreman Setting Entities" + - "Manage Setting Entities" author: - "Matthias M Dellweg (@mdellweg) ATIX AG" options: @@ -44,12 +44,12 @@ required: false type: raw extends_documentation_fragment: - - foreman + - redhat.satellite.foreman ''' EXAMPLES = ''' - name: "Set a Setting" - foreman_setting: + setting: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -57,7 +57,7 @@ value: "http://localhost:8088" - name: "Reset a Setting" - foreman_setting: + setting: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -72,7 +72,7 @@ ''' -from ansible.module_utils.foreman_helper import ForemanAnsibleModule, parameter_value_to_str, _foreman_spec_helper +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanAnsibleModule, parameter_value_to_str, _foreman_spec_helper class ForemanSettingModule(ForemanAnsibleModule): diff --git a/plugins/modules/foreman_smart_class_parameter.py b/plugins/modules/smart_class_parameter.py similarity index 93% rename from plugins/modules/foreman_smart_class_parameter.py rename to plugins/modules/smart_class_parameter.py index 784944e6..6054a946 100644 --- a/plugins/modules/foreman_smart_class_parameter.py +++ b/plugins/modules/smart_class_parameter.py @@ -25,11 +25,11 @@ DOCUMENTATION = ''' --- -module: foreman_smart_class_parameter -short_description: Manage Foreman Smart Class Parameters using Foreman API +module: smart_class_parameter +short_description: Manage Smart Class Parameters description: - - Update Foreman Smart Class Parameters using Foreman API. Smart Class Paramters are created/deleted at on puppet classes import - - and cannot be created or deleted via Foreman API. + - Update Smart Class Parameters. + - Smart Class Parameters are created/deleted for Puppet classes during import and cannot be created or deleted otherwise. author: - "Baptiste Agasse (@bagasse)" options: @@ -55,7 +55,7 @@ type: bool omit: description: - - Foreman will not send this parameter in classification output. + - Don't send this parameter in classification output. - Puppet will use the value defined in the Puppet manifest for this parameter. type: bool override_value_order: @@ -110,7 +110,7 @@ description: Override value, required if omit is false type: raw omit: - description: Foreman will not send this parameter in classification output, replaces use_puppet_default. + description: Don't send this parameter in classification output, replaces use_puppet_default. type: bool state: description: State of the entity. @@ -120,12 +120,12 @@ - present - present_with_defaults extends_documentation_fragment: - - foreman + - redhat.satellite.foreman ''' EXAMPLES = ''' - name: "Update prometheus::server alertmanagers_config param default value" - foreman_smart_class_parameter: + smart_class_parameter: puppetclass_name: "prometheus::server" parameter: alertmanagers_config override: true @@ -137,7 +137,7 @@ state: present - name: "Update prometheus::server alertmanagers_config param default value" - foreman_smart_class_parameter: + smart_class_parameter: puppetclass_name: "prometheus::server" parameter: alertmanagers_config override: true @@ -160,7 +160,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule, parameter_value_to_str +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule, parameter_value_to_str override_value_foreman_spec = dict( match=dict(required=True), diff --git a/plugins/modules/foreman_subnet.py b/plugins/modules/subnet.py similarity index 93% rename from plugins/modules/foreman_subnet.py rename to plugins/modules/subnet.py index b407e64c..c51cc988 100644 --- a/plugins/modules/foreman_subnet.py +++ b/plugins/modules/subnet.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_subnet -short_description: Manage Foreman Subnets using Foreman API +module: subnet +short_description: Manage Subnets description: - - Create and Delete Foreman Subnets using Foreman API + - Create, update, and delete Subnets author: - "Baptiste Agasse (@bagasse)" requirements: @@ -146,15 +146,15 @@ description: - Subnet specific host parameters extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy - - foreman.nested_parameters + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy + - redhat.satellite.foreman.nested_parameters ''' EXAMPLES = ''' - name: My subnet - foreman_subnet: + subnet: name: "My subnet" description: "My description" network: "192.168.0.0" @@ -185,7 +185,9 @@ RETURN = ''' # ''' import traceback -from ansible.module_utils.foreman_helper import ForemanTaxonomicEntityAnsibleModule, NestedParametersMixin +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( + ForemanTaxonomicEntityAnsibleModule, NestedParametersMixin, missing_required_lib +) try: import ipaddress HAS_IPADDRESS = True @@ -233,7 +235,7 @@ def main(): ) if not HAS_IPADDRESS: - module.fail_json(msg='The ipaddress Python module is required', exception=IPADDRESS_IMP_ERR) + module.fail_json(msg=missing_required_lib("ipaddress"), exception=IPADDRESS_IMP_ERR) module_params = module.foreman_params diff --git a/plugins/modules/katello_manifest.py b/plugins/modules/subscription_manifest.py similarity index 93% rename from plugins/modules/katello_manifest.py rename to plugins/modules/subscription_manifest.py index 14a12b2e..b367086b 100644 --- a/plugins/modules/katello_manifest.py +++ b/plugins/modules/subscription_manifest.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: katello_manifest -short_description: Manage Katello manifests +module: subscription_manifest +short_description: Manage manifests description: - - Upload and Manage Katello manifests + - Upload and manage manifests author: "Andrew Kofink (@akofink)" options: manifest_path: @@ -51,13 +51,13 @@ aliases: [ redhat_repository_url ] type: str extends_documentation_fragment: - - foreman - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Upload the RHEL developer edition manifest" - katello_manifest: + subscription_manifest: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -68,7 +68,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule def main(): diff --git a/plugins/modules/katello_sync_plan.py b/plugins/modules/sync_plan.py similarity index 93% rename from plugins/modules/katello_sync_plan.py rename to plugins/modules/sync_plan.py index d9c07c1a..775ec61e 100644 --- a/plugins/modules/katello_sync_plan.py +++ b/plugins/modules/sync_plan.py @@ -26,22 +26,22 @@ DOCUMENTATION = ''' --- -module: katello_sync_plan -short_description: Manage Katello sync plans +module: sync_plan +short_description: Manage sync plans description: - - Manage Katello sync plans + - Manage sync plans author: - "Andrew Kofink (@akofink)" - "Matthis Dellweg (@mdellweg) ATIX-AG" options: name: description: - - Name of the Katello sync plan + - Name of the sync plan required: true type: str description: description: - - Description of the Katello sync plan + - Description of the sync plan type: str interval: description: @@ -75,14 +75,14 @@ type: list elements: str extends_documentation_fragment: - - foreman - - foreman.entity_state_with_defaults - - foreman.organization + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state_with_defaults + - redhat.satellite.foreman.organization ''' EXAMPLES = ''' - name: "Create or update weekly RHEL sync plan" - katello_sync_plan: + sync_plan: username: "admin" password: "changeme" server_url: "https://foreman.example.com" @@ -99,7 +99,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import KatelloEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule class KatelloSyncPlanModule(KatelloEntityAnsibleModule): diff --git a/plugins/modules/foreman_templates_import.py b/plugins/modules/templates_import.py similarity index 95% rename from plugins/modules/foreman_templates_import.py rename to plugins/modules/templates_import.py index 6bf2f484..6e3ca2cb 100644 --- a/plugins/modules/foreman_templates_import.py +++ b/plugins/modules/templates_import.py @@ -25,7 +25,7 @@ DOCUMENTATION = ''' --- -module: foreman_templates_import +module: templates_import short_description: Sync templates from a repository description: - Sync provisioning templates, report_templates, partition tables and job templates from external git repository or file system. @@ -94,13 +94,13 @@ required: false type: str extends_documentation_fragment: - - foreman - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: Sync templates from git repo - foreman_templates_import: + templates_import: repo: https://github.com/theforeman/community-templates.git branch: 1.24-stable associate: new @@ -111,7 +111,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanTaxonomicAnsibleModule, _flatten_entity +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanTaxonomicAnsibleModule, _flatten_entity def main(): diff --git a/plugins/modules/foreman_user.py b/plugins/modules/user.py similarity index 97% rename from plugins/modules/foreman_user.py rename to plugins/modules/user.py index e6ff9e5a..db9d92d3 100644 --- a/plugins/modules/foreman_user.py +++ b/plugins/modules/user.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_user -short_description: Manage Foreman Users +module: user +short_description: Manage Users description: - - Create and delete users in Foreman + - Create, update, and delete users author: - "Christoffer Reijer (@ephracis) Basalt AB" options: @@ -274,14 +274,14 @@ type: list elements: str extends_documentation_fragment: - - foreman - - foreman.entity_state - - foreman.taxonomy + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state + - redhat.satellite.foreman.taxonomy ''' EXAMPLES = ''' - name: Create a user - foreman_user: + user: name: test firstname: Test lastname: Userson @@ -303,13 +303,13 @@ state: present - name: Update a user - foreman_user: + user: name: test firstname: Tester state: present - name: Change password - foreman_user: + user: name: test user_password: newp@ss @@ -317,7 +317,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ( +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ( ForemanTaxonomicEntityAnsibleModule, ) diff --git a/plugins/modules/foreman_usergroup.py b/plugins/modules/usergroup.py similarity index 90% rename from plugins/modules/foreman_usergroup.py rename to plugins/modules/usergroup.py index 4df243a7..e6ddbbcf 100644 --- a/plugins/modules/foreman_usergroup.py +++ b/plugins/modules/usergroup.py @@ -25,10 +25,10 @@ DOCUMENTATION = ''' --- -module: foreman_usergroup -short_description: Manage Foreman User groups +module: usergroup +short_description: Manage User groups description: - - Create and delete user groups in Foreman + - Create, update, and delete user groups author: - "Baptiste Agasse (@bagasse)" options: @@ -67,13 +67,13 @@ type: list elements: str extends_documentation_fragment: - - foreman - - foreman.entity_state + - redhat.satellite.foreman + - redhat.satellite.foreman.entity_state ''' EXAMPLES = ''' - name: Create a user group - foreman_usergroup: + usergroup: name: test admin: no roles: @@ -88,7 +88,7 @@ RETURN = ''' # ''' -from ansible.module_utils.foreman_helper import ForemanEntityAnsibleModule +from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule class ForemanUsergroupModule(ForemanEntityAnsibleModule): diff --git a/requirements-dev.txt b/requirements-dev.txt index 8911f481..cacb21e9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,4 +8,5 @@ rpm-py-installer docker git+https://github.com/Apipie/apypie.git@master#egg=apypie -r requirements-common.txt --r https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.txt +-r https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.pylint.txt +-r https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt diff --git a/tests/conftest.py b/tests/conftest.py index 2e7a501a..59a4483e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,7 +14,7 @@ 'content_view_filter', 'content_view_version', 'domain', - 'environment', + 'puppet_environment', 'external_usergroup', 'config_group', 'filters', @@ -30,16 +30,16 @@ 'installation_medium', 'job_template', 'katello_manifest', - 'katello_sync', + 'repository_sync', 'lifecycle_environment', 'location', - 'model', + 'hardware_model', 'operatingsystem', 'organization', 'os_default_template', 'product', 'provisioning_template', - 'ptable', + 'partition_table', 'realm', 'redhat_manifest', 'repository', @@ -47,13 +47,13 @@ 'role', 'scap_content', 'scap_tailoring_file', - 'search_facts', + 'resource_info', 'setting', 'smart_class_parameter', 'subnet', 'sync_plan', 'templates_import', - 'upload', + 'content_upload', 'user', 'usergroup', ] diff --git a/tests/fixtures/apidoc/katello_sync.json b/tests/fixtures/apidoc/content_upload.json similarity index 100% rename from tests/fixtures/apidoc/katello_sync.json rename to tests/fixtures/apidoc/content_upload.json diff --git a/tests/fixtures/apidoc/environment.json b/tests/fixtures/apidoc/hardware_model.json similarity index 100% rename from tests/fixtures/apidoc/environment.json rename to tests/fixtures/apidoc/hardware_model.json diff --git a/tests/fixtures/apidoc/model.json b/tests/fixtures/apidoc/partition_table.json similarity index 100% rename from tests/fixtures/apidoc/model.json rename to tests/fixtures/apidoc/partition_table.json diff --git a/tests/fixtures/apidoc/ptable.json b/tests/fixtures/apidoc/puppet_environment.json similarity index 100% rename from tests/fixtures/apidoc/ptable.json rename to tests/fixtures/apidoc/puppet_environment.json diff --git a/tests/fixtures/apidoc/upload.json b/tests/fixtures/apidoc/repository_sync.json similarity index 100% rename from tests/fixtures/apidoc/upload.json rename to tests/fixtures/apidoc/repository_sync.json diff --git a/tests/fixtures/apidoc/search_facts.json b/tests/fixtures/apidoc/resource_info.json similarity index 100% rename from tests/fixtures/apidoc/search_facts.json rename to tests/fixtures/apidoc/resource_info.json diff --git a/tests/inventory/tests.foreman.yml b/tests/inventory/tests.foreman.yml index dfc80cae..f3531ca1 100644 --- a/tests/inventory/tests.foreman.yml +++ b/tests/inventory/tests.foreman.yml @@ -1,4 +1,4 @@ -plugin: foreman +plugin: redhat.satellite.foreman url: http://localhost:3000/ user: admin password: changeme diff --git a/tests/test_module_state.py b/tests/test_module_state.py index 5ddf41a4..453513a9 100644 --- a/tests/test_module_state.py +++ b/tests/test_module_state.py @@ -26,18 +26,15 @@ def find_all_modules(): ALL_MODULES = list(find_all_modules()) -def _strip_module_prefix(module): - return module.replace('foreman_', '').replace('katello_', '') - - def _module_file_path(module): module_file_name = "{}.py".format(module) return MODULES_PATH / module_file_name def _module_is_tested(module): - short_module = _strip_module_prefix(module) - return short_module in TEST_PLAYBOOKS or module in TEST_PLAYBOOKS + if module == 'subscription_manifest': + module = 'katello_manifest' + return module in TEST_PLAYBOOKS def _module_framework(module): @@ -51,7 +48,7 @@ def _module_framework_from_body(body): framework = None for entry in body: if isinstance(entry, ast.ImportFrom): - if entry.module == 'ansible.module_utils.foreman_helper' and not framework: + if entry.module == 'ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper' and not framework: framework = 'apypie' elif isinstance(entry, ast_try) and not framework: framework = _module_framework_from_body(entry.body) diff --git a/tests/test_playbooks/activation_key.yml b/tests/test_playbooks/activation_key.yml index ace2ae15..00c5fb54 100644 --- a/tests/test_playbooks/activation_key.yml +++ b/tests/test_playbooks/activation_key.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite tags: - setup gather_facts: false @@ -27,6 +29,8 @@ activation_key_name: Test Activation Key Copy - hosts: tests + collections: + - redhat.satellite tags: - test gather_facts: false @@ -258,6 +262,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite tags: - teardown gather_facts: false diff --git a/tests/test_playbooks/architecture.yml b/tests/test_playbooks/architecture.yml index 7f846f6a..68185b1b 100644 --- a/tests/test_playbooks/architecture.yml +++ b/tests/test_playbooks/architecture.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -25,6 +27,8 @@ architecture_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -108,6 +112,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/auth_source_ldap.yml b/tests/test_playbooks/auth_source_ldap.yml index e9661e1c..3e17a01e 100644 --- a/tests/test_playbooks/auth_source_ldap.yml +++ b/tests/test_playbooks/auth_source_ldap.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -20,6 +22,8 @@ with_items: "{{ domain_organizations }}" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -58,6 +62,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/bookmark.yml b/tests/test_playbooks/bookmark.yml index 978362af..0bfa096c 100644 --- a/tests/test_playbooks/bookmark.yml +++ b/tests/test_playbooks/bookmark.yml @@ -1,5 +1,7 @@ --- - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/compute_attribute.yml b/tests/test_playbooks/compute_attribute.yml index 60ed99ce..535f245a 100644 --- a/tests/test_playbooks/compute_attribute.yml +++ b/tests/test_playbooks/compute_attribute.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -23,6 +25,8 @@ compute_resource_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false tasks: - name: Load server config @@ -62,6 +66,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/compute_profile.yml b/tests/test_playbooks/compute_profile.yml index 06048f27..3bd3f51c 100644 --- a/tests/test_playbooks/compute_profile.yml +++ b/tests/test_playbooks/compute_profile.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -28,6 +30,8 @@ compute_profile_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -75,6 +79,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/compute_resource.yml b/tests/test_playbooks/compute_resource.yml index ddc1272b..7d01c521 100644 --- a/tests/test_playbooks/compute_resource.yml +++ b/tests/test_playbooks/compute_resource.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -11,6 +13,8 @@ vars: location_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -117,6 +121,8 @@ compute_resource_state: absent expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/config_group.yml b/tests/test_playbooks/config_group.yml index d7da6d34..df595efc 100644 --- a/tests/test_playbooks/config_group.yml +++ b/tests/test_playbooks/config_group.yml @@ -4,6 +4,8 @@ # before running config_group tests # - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/content_credential.yml b/tests/test_playbooks/content_credential.yml index df5b0f92..dd46497a 100644 --- a/tests/test_playbooks/content_credential.yml +++ b/tests/test_playbooks/content_credential.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -9,6 +11,8 @@ organization_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -56,6 +60,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/upload.yml b/tests/test_playbooks/content_upload.yml similarity index 96% rename from tests/test_playbooks/upload.yml rename to tests/test_playbooks/content_upload.yml index fc349b44..5fdfbf02 100644 --- a/tests/test_playbooks/upload.yml +++ b/tests/test_playbooks/content_upload.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -38,6 +40,8 @@ repository_content_type: "file" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -78,6 +82,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/content_view.yml b/tests/test_playbooks/content_view.yml index 76aaca65..4bbd2c53 100644 --- a/tests/test_playbooks/content_view.yml +++ b/tests/test_playbooks/content_view.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -35,6 +37,8 @@ content_view_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -196,6 +200,8 @@ auto_publish: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/content_view_filter.yml b/tests/test_playbooks/content_view_filter.yml index fa8cf54f..f0384eea 100644 --- a/tests/test_playbooks/content_view_filter.yml +++ b/tests/test_playbooks/content_view_filter.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -34,6 +36,8 @@ product: "Test Product" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -167,6 +171,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/content_view_version.yml b/tests/test_playbooks/content_view_version.yml index 9e641476..e93e2be5 100644 --- a/tests/test_playbooks/content_view_version.yml +++ b/tests/test_playbooks/content_view_version.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -42,6 +44,8 @@ product: "Test Product" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -124,6 +128,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/domain.yml b/tests/test_playbooks/domain.yml index 7193cc29..1f1172c2 100644 --- a/tests/test_playbooks/domain.yml +++ b/tests/test_playbooks/domain.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -18,6 +20,8 @@ #TODO create smart_proxy, when ansible-module exists - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -132,6 +136,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/external_usergroup.yml b/tests/test_playbooks/external_usergroup.yml index 71eaeab1..d5845f70 100644 --- a/tests/test_playbooks/external_usergroup.yml +++ b/tests/test_playbooks/external_usergroup.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -22,6 +24,8 @@ auth_source_ldap_tls: false - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -52,6 +56,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite tags: - teardown gather_facts: false diff --git a/tests/test_playbooks/filters.yml b/tests/test_playbooks/filters.yml index fcd019c5..1c6c4835 100644 --- a/tests/test_playbooks/filters.yml +++ b/tests/test_playbooks/filters.yml @@ -1,15 +1,17 @@ --- - hosts: tests + collections: + - redhat.satellite tags: - test gather_facts: false tasks: - debug: - msg: "{{ 'Test__String)' | cp_label }}" + msg: "{{ 'Test__String)' | redhat.satellite.cp_label }}" - assert: that: - - "{{ 'Test String' | cp_label == 'Test_String' }}" - - "{{ 'Test__String' | cp_label == 'Test__String' }}" - - "{{ 'Test--String' | cp_label == 'Test--String' }}" - - "{{ 'Test (String) 1234' | cp_label == 'Test_String_1234' }}" + - "{{ 'Test String' | redhat.satellite.cp_label == 'Test_String' }}" + - "{{ 'Test__String' | redhat.satellite.cp_label == 'Test__String' }}" + - "{{ 'Test--String' | redhat.satellite.cp_label == 'Test--String' }}" + - "{{ 'Test (String) 1234' | redhat.satellite.cp_label == 'Test_String_1234' }}" ... diff --git a/tests/test_playbooks/fixtures/upload-0.yml b/tests/test_playbooks/fixtures/content_upload-0.yml similarity index 100% rename from tests/test_playbooks/fixtures/upload-0.yml rename to tests/test_playbooks/fixtures/content_upload-0.yml diff --git a/tests/test_playbooks/fixtures/upload-1.yml b/tests/test_playbooks/fixtures/content_upload-1.yml similarity index 100% rename from tests/test_playbooks/fixtures/upload-1.yml rename to tests/test_playbooks/fixtures/content_upload-1.yml diff --git a/tests/test_playbooks/fixtures/upload-2.yml b/tests/test_playbooks/fixtures/content_upload-2.yml similarity index 100% rename from tests/test_playbooks/fixtures/upload-2.yml rename to tests/test_playbooks/fixtures/content_upload-2.yml diff --git a/tests/test_playbooks/fixtures/upload-3.yml b/tests/test_playbooks/fixtures/content_upload-3.yml similarity index 100% rename from tests/test_playbooks/fixtures/upload-3.yml rename to tests/test_playbooks/fixtures/content_upload-3.yml diff --git a/tests/test_playbooks/fixtures/upload-4.yml b/tests/test_playbooks/fixtures/content_upload-4.yml similarity index 100% rename from tests/test_playbooks/fixtures/upload-4.yml rename to tests/test_playbooks/fixtures/content_upload-4.yml diff --git a/tests/test_playbooks/fixtures/upload-5.yml b/tests/test_playbooks/fixtures/content_upload-5.yml similarity index 100% rename from tests/test_playbooks/fixtures/upload-5.yml rename to tests/test_playbooks/fixtures/content_upload-5.yml diff --git a/tests/test_playbooks/fixtures/model-0.yml b/tests/test_playbooks/fixtures/hardware_model-0.yml similarity index 100% rename from tests/test_playbooks/fixtures/model-0.yml rename to tests/test_playbooks/fixtures/hardware_model-0.yml diff --git a/tests/test_playbooks/fixtures/model-1.yml b/tests/test_playbooks/fixtures/hardware_model-1.yml similarity index 100% rename from tests/test_playbooks/fixtures/model-1.yml rename to tests/test_playbooks/fixtures/hardware_model-1.yml diff --git a/tests/test_playbooks/fixtures/model-2.yml b/tests/test_playbooks/fixtures/hardware_model-2.yml similarity index 100% rename from tests/test_playbooks/fixtures/model-2.yml rename to tests/test_playbooks/fixtures/hardware_model-2.yml diff --git a/tests/test_playbooks/fixtures/model-3.yml b/tests/test_playbooks/fixtures/hardware_model-3.yml similarity index 100% rename from tests/test_playbooks/fixtures/model-3.yml rename to tests/test_playbooks/fixtures/hardware_model-3.yml diff --git a/tests/test_playbooks/fixtures/model-4.yml b/tests/test_playbooks/fixtures/hardware_model-4.yml similarity index 100% rename from tests/test_playbooks/fixtures/model-4.yml rename to tests/test_playbooks/fixtures/hardware_model-4.yml diff --git a/tests/test_playbooks/fixtures/model-5.yml b/tests/test_playbooks/fixtures/hardware_model-5.yml similarity index 100% rename from tests/test_playbooks/fixtures/model-5.yml rename to tests/test_playbooks/fixtures/hardware_model-5.yml diff --git a/tests/test_playbooks/fixtures/ptable-0.yml b/tests/test_playbooks/fixtures/partition_table-0.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-0.yml rename to tests/test_playbooks/fixtures/partition_table-0.yml diff --git a/tests/test_playbooks/fixtures/ptable-1.yml b/tests/test_playbooks/fixtures/partition_table-1.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-1.yml rename to tests/test_playbooks/fixtures/partition_table-1.yml diff --git a/tests/test_playbooks/fixtures/ptable-10.yml b/tests/test_playbooks/fixtures/partition_table-10.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-10.yml rename to tests/test_playbooks/fixtures/partition_table-10.yml diff --git a/tests/test_playbooks/fixtures/ptable-11.yml b/tests/test_playbooks/fixtures/partition_table-11.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-11.yml rename to tests/test_playbooks/fixtures/partition_table-11.yml diff --git a/tests/test_playbooks/fixtures/ptable-12.yml b/tests/test_playbooks/fixtures/partition_table-12.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-12.yml rename to tests/test_playbooks/fixtures/partition_table-12.yml diff --git a/tests/test_playbooks/fixtures/ptable-13.yml b/tests/test_playbooks/fixtures/partition_table-13.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-13.yml rename to tests/test_playbooks/fixtures/partition_table-13.yml diff --git a/tests/test_playbooks/fixtures/ptable-14.yml b/tests/test_playbooks/fixtures/partition_table-14.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-14.yml rename to tests/test_playbooks/fixtures/partition_table-14.yml diff --git a/tests/test_playbooks/fixtures/ptable-15.yml b/tests/test_playbooks/fixtures/partition_table-15.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-15.yml rename to tests/test_playbooks/fixtures/partition_table-15.yml diff --git a/tests/test_playbooks/fixtures/ptable-16.yml b/tests/test_playbooks/fixtures/partition_table-16.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-16.yml rename to tests/test_playbooks/fixtures/partition_table-16.yml diff --git a/tests/test_playbooks/fixtures/ptable-17.yml b/tests/test_playbooks/fixtures/partition_table-17.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-17.yml rename to tests/test_playbooks/fixtures/partition_table-17.yml diff --git a/tests/test_playbooks/fixtures/ptable-18.yml b/tests/test_playbooks/fixtures/partition_table-18.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-18.yml rename to tests/test_playbooks/fixtures/partition_table-18.yml diff --git a/tests/test_playbooks/fixtures/ptable-19.yml b/tests/test_playbooks/fixtures/partition_table-19.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-19.yml rename to tests/test_playbooks/fixtures/partition_table-19.yml diff --git a/tests/test_playbooks/fixtures/ptable-2.yml b/tests/test_playbooks/fixtures/partition_table-2.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-2.yml rename to tests/test_playbooks/fixtures/partition_table-2.yml diff --git a/tests/test_playbooks/fixtures/ptable-20.yml b/tests/test_playbooks/fixtures/partition_table-20.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-20.yml rename to tests/test_playbooks/fixtures/partition_table-20.yml diff --git a/tests/test_playbooks/fixtures/ptable-3.yml b/tests/test_playbooks/fixtures/partition_table-3.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-3.yml rename to tests/test_playbooks/fixtures/partition_table-3.yml diff --git a/tests/test_playbooks/fixtures/ptable-4.yml b/tests/test_playbooks/fixtures/partition_table-4.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-4.yml rename to tests/test_playbooks/fixtures/partition_table-4.yml diff --git a/tests/test_playbooks/fixtures/ptable-5.yml b/tests/test_playbooks/fixtures/partition_table-5.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-5.yml rename to tests/test_playbooks/fixtures/partition_table-5.yml diff --git a/tests/test_playbooks/fixtures/ptable-6.yml b/tests/test_playbooks/fixtures/partition_table-6.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-6.yml rename to tests/test_playbooks/fixtures/partition_table-6.yml diff --git a/tests/test_playbooks/fixtures/ptable-7.yml b/tests/test_playbooks/fixtures/partition_table-7.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-7.yml rename to tests/test_playbooks/fixtures/partition_table-7.yml diff --git a/tests/test_playbooks/fixtures/ptable-8.yml b/tests/test_playbooks/fixtures/partition_table-8.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-8.yml rename to tests/test_playbooks/fixtures/partition_table-8.yml diff --git a/tests/test_playbooks/fixtures/ptable-9.yml b/tests/test_playbooks/fixtures/partition_table-9.yml similarity index 100% rename from tests/test_playbooks/fixtures/ptable-9.yml rename to tests/test_playbooks/fixtures/partition_table-9.yml diff --git a/tests/test_playbooks/fixtures/environment-0.yml b/tests/test_playbooks/fixtures/puppet_environment-0.yml similarity index 100% rename from tests/test_playbooks/fixtures/environment-0.yml rename to tests/test_playbooks/fixtures/puppet_environment-0.yml diff --git a/tests/test_playbooks/fixtures/environment-1.yml b/tests/test_playbooks/fixtures/puppet_environment-1.yml similarity index 100% rename from tests/test_playbooks/fixtures/environment-1.yml rename to tests/test_playbooks/fixtures/puppet_environment-1.yml diff --git a/tests/test_playbooks/fixtures/environment-2.yml b/tests/test_playbooks/fixtures/puppet_environment-2.yml similarity index 100% rename from tests/test_playbooks/fixtures/environment-2.yml rename to tests/test_playbooks/fixtures/puppet_environment-2.yml diff --git a/tests/test_playbooks/fixtures/environment-3.yml b/tests/test_playbooks/fixtures/puppet_environment-3.yml similarity index 100% rename from tests/test_playbooks/fixtures/environment-3.yml rename to tests/test_playbooks/fixtures/puppet_environment-3.yml diff --git a/tests/test_playbooks/fixtures/environment-4.yml b/tests/test_playbooks/fixtures/puppet_environment-4.yml similarity index 100% rename from tests/test_playbooks/fixtures/environment-4.yml rename to tests/test_playbooks/fixtures/puppet_environment-4.yml diff --git a/tests/test_playbooks/fixtures/environment-5.yml b/tests/test_playbooks/fixtures/puppet_environment-5.yml similarity index 100% rename from tests/test_playbooks/fixtures/environment-5.yml rename to tests/test_playbooks/fixtures/puppet_environment-5.yml diff --git a/tests/test_playbooks/fixtures/katello_sync-0.yml b/tests/test_playbooks/fixtures/repository_sync-0.yml similarity index 100% rename from tests/test_playbooks/fixtures/katello_sync-0.yml rename to tests/test_playbooks/fixtures/repository_sync-0.yml diff --git a/tests/test_playbooks/fixtures/katello_sync-1.yml b/tests/test_playbooks/fixtures/repository_sync-1.yml similarity index 100% rename from tests/test_playbooks/fixtures/katello_sync-1.yml rename to tests/test_playbooks/fixtures/repository_sync-1.yml diff --git a/tests/test_playbooks/fixtures/search_facts-0.yml b/tests/test_playbooks/fixtures/resource_info-0.yml similarity index 100% rename from tests/test_playbooks/fixtures/search_facts-0.yml rename to tests/test_playbooks/fixtures/resource_info-0.yml diff --git a/tests/test_playbooks/fixtures/search_facts-1.yml b/tests/test_playbooks/fixtures/resource_info-1.yml similarity index 100% rename from tests/test_playbooks/fixtures/search_facts-1.yml rename to tests/test_playbooks/fixtures/resource_info-1.yml diff --git a/tests/test_playbooks/fixtures/search_facts-2.yml b/tests/test_playbooks/fixtures/resource_info-2.yml similarity index 100% rename from tests/test_playbooks/fixtures/search_facts-2.yml rename to tests/test_playbooks/fixtures/resource_info-2.yml diff --git a/tests/test_playbooks/fixtures/search_facts-3.yml b/tests/test_playbooks/fixtures/resource_info-3.yml similarity index 100% rename from tests/test_playbooks/fixtures/search_facts-3.yml rename to tests/test_playbooks/fixtures/resource_info-3.yml diff --git a/tests/test_playbooks/fixtures/search_facts-4.yml b/tests/test_playbooks/fixtures/resource_info-4.yml similarity index 100% rename from tests/test_playbooks/fixtures/search_facts-4.yml rename to tests/test_playbooks/fixtures/resource_info-4.yml diff --git a/tests/test_playbooks/fixtures/search_facts-5.yml b/tests/test_playbooks/fixtures/resource_info-5.yml similarity index 100% rename from tests/test_playbooks/fixtures/search_facts-5.yml rename to tests/test_playbooks/fixtures/resource_info-5.yml diff --git a/tests/test_playbooks/fixtures/search_facts-6.yml b/tests/test_playbooks/fixtures/resource_info-6.yml similarity index 100% rename from tests/test_playbooks/fixtures/search_facts-6.yml rename to tests/test_playbooks/fixtures/resource_info-6.yml diff --git a/tests/test_playbooks/global_parameter.yml b/tests/test_playbooks/global_parameter.yml index 6937f352..eed1a7ce 100644 --- a/tests/test_playbooks/global_parameter.yml +++ b/tests/test_playbooks/global_parameter.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -8,6 +10,8 @@ vars: global_parameter_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/model.yml b/tests/test_playbooks/hardware_model.yml similarity index 92% rename from tests/test_playbooks/model.yml rename to tests/test_playbooks/hardware_model.yml index e1076c90..fbe2208f 100644 --- a/tests/test_playbooks/model.yml +++ b/tests/test_playbooks/hardware_model.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -9,6 +11,8 @@ model_state: "absent" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -47,6 +51,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/host.yml b/tests/test_playbooks/host.yml index 4c9598f6..56f4bca7 100644 --- a/tests/test_playbooks/host.yml +++ b/tests/test_playbooks/host.yml @@ -10,6 +10,8 @@ command: hammer proxy import-classes --puppet-environment production --name {{ ansible_fqdn }} - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -88,6 +90,8 @@ host_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -373,6 +377,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/host_collection.yml b/tests/test_playbooks/host_collection.yml index 3c3994b6..b31a22ef 100644 --- a/tests/test_playbooks/host_collection.yml +++ b/tests/test_playbooks/host_collection.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -9,6 +11,8 @@ organization_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -66,6 +70,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/host_power.yml b/tests/test_playbooks/host_power.yml index 2365e038..bff727f4 100644 --- a/tests/test_playbooks/host_power.yml +++ b/tests/test_playbooks/host_power.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -12,6 +14,8 @@ host_power_state: "off" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/hostgroup.yml b/tests/test_playbooks/hostgroup.yml index e52fa807..3a722a98 100644 --- a/tests/test_playbooks/hostgroup.yml +++ b/tests/test_playbooks/hostgroup.yml @@ -8,6 +8,8 @@ ## - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -89,6 +91,8 @@ hostgroup_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -548,6 +552,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/image.yml b/tests/test_playbooks/image.yml index 4f16a943..eb86a856 100644 --- a/tests/test_playbooks/image.yml +++ b/tests/test_playbooks/image.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -67,6 +69,8 @@ - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -165,6 +169,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/installation_medium.yml b/tests/test_playbooks/installation_medium.yml index 1d6180e8..646c0767 100644 --- a/tests/test_playbooks/installation_medium.yml +++ b/tests/test_playbooks/installation_medium.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -17,6 +19,8 @@ - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -116,6 +120,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/inventory_plugin.yml b/tests/test_playbooks/inventory_plugin.yml index 56f30439..315beae3 100644 --- a/tests/test_playbooks/inventory_plugin.yml +++ b/tests/test_playbooks/inventory_plugin.yml @@ -9,6 +9,7 @@ testhost2.example.com: group_b collections: - community.general + - redhat.satellite tasks: - name: fetch Foreman container docker_image: @@ -40,7 +41,7 @@ delay: 10 - name: create test hostgroups - foreman_hostgroup: + hostgroup: username: admin password: changeme server_url: http://127.0.0.1:3000/ @@ -52,7 +53,7 @@ with_items: "{{ foreman_groups }}" - name: create test hosts - foreman_host: + host: username: admin password: changeme server_url: http://127.0.0.1:3000/ diff --git a/tests/test_playbooks/job_template.yml b/tests/test_playbooks/job_template.yml index c8bfcef0..adbc93eb 100644 --- a/tests/test_playbooks/job_template.yml +++ b/tests/test_playbooks/job_template.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -23,6 +25,8 @@ - "delete file" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -170,6 +174,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/katello_hostgroup.yml b/tests/test_playbooks/katello_hostgroup.yml index 55593b26..d3ee7f25 100644 --- a/tests/test_playbooks/katello_hostgroup.yml +++ b/tests/test_playbooks/katello_hostgroup.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -30,6 +32,8 @@ hostgroup_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -72,6 +76,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/katello_manifest.yml b/tests/test_playbooks/katello_manifest.yml index 217296d3..11622e1e 100644 --- a/tests/test_playbooks/katello_manifest.yml +++ b/tests/test_playbooks/katello_manifest.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -12,6 +14,8 @@ manifest_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -62,6 +66,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/lifecycle_environment.yml b/tests/test_playbooks/lifecycle_environment.yml index 9c7af803..034a2a86 100644 --- a/tests/test_playbooks/lifecycle_environment.yml +++ b/tests/test_playbooks/lifecycle_environment.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -18,6 +20,8 @@ - Dev - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -88,6 +92,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/location.yml b/tests/test_playbooks/location.yml index c5f2b1a2..285e8f9d 100644 --- a/tests/test_playbooks/location.yml +++ b/tests/test_playbooks/location.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -18,6 +20,8 @@ organization_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -183,6 +187,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/luna_hostgroup.yml b/tests/test_playbooks/luna_hostgroup.yml index 4b5bce4a..631b4eed 100644 --- a/tests/test_playbooks/luna_hostgroup.yml +++ b/tests/test_playbooks/luna_hostgroup.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -20,6 +22,8 @@ hostgroup_name: "New host group" hostgroup_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -56,6 +60,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/operatingsystem.yml b/tests/test_playbooks/operatingsystem.yml index 2f2c0927..4e75b3e1 100644 --- a/tests/test_playbooks/operatingsystem.yml +++ b/tests/test_playbooks/operatingsystem.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -13,6 +15,8 @@ operatingsystem_minor: 1 operatingsystem_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/organization.yml b/tests/test_playbooks/organization.yml index 6ce988a5..a53a75b0 100644 --- a/tests/test_playbooks/organization.yml +++ b/tests/test_playbooks/organization.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -8,6 +10,8 @@ vars: organization_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/os_default_template.yml b/tests/test_playbooks/os_default_template.yml index 2587e75c..ad8a7911 100644 --- a/tests/test_playbooks/os_default_template.yml +++ b/tests/test_playbooks/os_default_template.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -26,6 +28,8 @@ os_default_template_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -66,6 +70,8 @@ - finish - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/ptable.yml b/tests/test_playbooks/partition_table.yml similarity index 97% rename from tests/test_playbooks/ptable.yml rename to tests/test_playbooks/partition_table.yml index 532ef1cb..ccb8f394 100644 --- a/tests/test_playbooks/ptable.yml +++ b/tests/test_playbooks/partition_table.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -12,6 +14,8 @@ location_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -163,6 +167,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/product.yml b/tests/test_playbooks/product.yml index 6a5c801a..f865c276 100644 --- a/tests/test_playbooks/product.yml +++ b/tests/test_playbooks/product.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -22,6 +24,8 @@ vars: product_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -106,6 +110,8 @@ product_state: absent expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/provisioning_template.yml b/tests/test_playbooks/provisioning_template.yml index e36c3f17..6f51e81b 100644 --- a/tests/test_playbooks/provisioning_template.yml +++ b/tests/test_playbooks/provisioning_template.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -23,6 +25,8 @@ location_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -139,6 +143,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/environment.yml b/tests/test_playbooks/puppet_environment.yml similarity index 92% rename from tests/test_playbooks/environment.yml rename to tests/test_playbooks/puppet_environment.yml index 221fa87c..88e41599 100644 --- a/tests/test_playbooks/environment.yml +++ b/tests/test_playbooks/puppet_environment.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -12,6 +14,8 @@ location_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -44,6 +48,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/realm.yml b/tests/test_playbooks/realm.yml index 276a82f9..cfbd404b 100644 --- a/tests/test_playbooks/realm.yml +++ b/tests/test_playbooks/realm.yml @@ -3,6 +3,8 @@ # might need to run its provisioning playbook by hand. --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -11,6 +13,8 @@ vars: realm_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/redhat_manifest.yml b/tests/test_playbooks/redhat_manifest.yml index 1698b222..25cf4c0e 100644 --- a/tests/test_playbooks/redhat_manifest.yml +++ b/tests/test_playbooks/redhat_manifest.yml @@ -1,5 +1,7 @@ --- - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/repository.yml b/tests/test_playbooks/repository.yml index d17b5b51..d93c0bdb 100644 --- a/tests/test_playbooks/repository.yml +++ b/tests/test_playbooks/repository.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -20,6 +22,8 @@ product_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -188,6 +192,8 @@ repository_content_type: docker - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/repository_set.yml b/tests/test_playbooks/repository_set.yml index 2a2aca59..24607a84 100644 --- a/tests/test_playbooks/repository_set.yml +++ b/tests/test_playbooks/repository_set.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -18,6 +20,8 @@ state: disabled - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -175,6 +179,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/katello_sync.yml b/tests/test_playbooks/repository_sync.yml similarity index 89% rename from tests/test_playbooks/katello_sync.yml rename to tests/test_playbooks/repository_sync.yml index a71b9567..a9ee6a77 100644 --- a/tests/test_playbooks/katello_sync.yml +++ b/tests/test_playbooks/repository_sync.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -15,6 +17,8 @@ repository_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -27,6 +31,8 @@ repository: "Test Repository" - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/search_facts.yml b/tests/test_playbooks/resource_info.yml similarity index 94% rename from tests/test_playbooks/search_facts.yml rename to tests/test_playbooks/resource_info.yml index 650e2ecb..3628fb4b 100644 --- a/tests/test_playbooks/search_facts.yml +++ b/tests/test_playbooks/resource_info.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -20,6 +22,8 @@ loop: "{{ test_resources }}" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -45,7 +49,7 @@ organization: "Facts Organization" return_length: 1 - name: find organization id - foreman_search_facts: + resource_info: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" @@ -60,7 +64,7 @@ organization_id: "{{ org_search.resources[0]['id'] }}" return_length: 1 - name: Run with invalid resource - foreman_search_facts: + resource_info: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" @@ -73,6 +77,8 @@ when: "'config_groups' not in result.msg" - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/role.yml b/tests/test_playbooks/role.yml index e996538d..261df135 100644 --- a/tests/test_playbooks/role.yml +++ b/tests/test_playbooks/role.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -19,6 +21,8 @@ - role_with_filters - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -116,6 +120,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/scap_content.yml b/tests/test_playbooks/scap_content.yml index 4bec33cf..a2837385 100644 --- a/tests/test_playbooks/scap_content.yml +++ b/tests/test_playbooks/scap_content.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -19,6 +21,8 @@ - updated_scap_content_title - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -84,6 +88,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/scap_tailoring_file.yml b/tests/test_playbooks/scap_tailoring_file.yml index 457b4482..ea828ed8 100644 --- a/tests/test_playbooks/scap_tailoring_file.yml +++ b/tests/test_playbooks/scap_tailoring_file.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -19,6 +21,8 @@ - updated_scap_tailoring_file_name - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -84,6 +88,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/setting.yml b/tests/test_playbooks/setting.yml index 02026ab7..7b4c0419 100644 --- a/tests/test_playbooks/setting.yml +++ b/tests/test_playbooks/setting.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -13,6 +15,8 @@ setting_name: token_duration - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/smart_class_parameter.yml b/tests/test_playbooks/smart_class_parameter.yml index 81f29a55..495ca5b0 100644 --- a/tests/test_playbooks/smart_class_parameter.yml +++ b/tests/test_playbooks/smart_class_parameter.yml @@ -8,6 +8,8 @@ ## - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -52,6 +54,8 @@ - stepout - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -523,6 +527,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/subnet.yml b/tests/test_playbooks/subnet.yml index c0a38916..a06e8f96 100644 --- a/tests/test_playbooks/subnet.yml +++ b/tests/test_playbooks/subnet.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -29,6 +31,8 @@ subnet_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -251,6 +255,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/sync_plan.yml b/tests/test_playbooks/sync_plan.yml index 818ddff2..d24e8de7 100644 --- a/tests/test_playbooks/sync_plan.yml +++ b/tests/test_playbooks/sync_plan.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -15,6 +17,8 @@ sync_plan_state: absent - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -70,6 +74,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/tasks/activation_key.yml b/tests/test_playbooks/tasks/activation_key.yml index a81f9e17..45d07c48 100644 --- a/tests/test_playbooks/tasks/activation_key.yml +++ b/tests/test_playbooks/tasks/activation_key.yml @@ -4,7 +4,7 @@ activation_key_name: "Test Activation Key" activation_key_state: "present" activation_key_organization: "Test Organization" - katello_activation_key: + activation_key: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/architecture.yml b/tests/test_playbooks/tasks/architecture.yml index 87f70f01..20e467c6 100644 --- a/tests/test_playbooks/tasks/architecture.yml +++ b/tests/test_playbooks/tasks/architecture.yml @@ -3,7 +3,7 @@ vars: architecture_name: "rĂ¼sc256" architecture_state: present - foreman_architecture: + architecture: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/auth_source_ldap.yml b/tests/test_playbooks/tasks/auth_source_ldap.yml index aa60a077..5cbde264 100644 --- a/tests/test_playbooks/tasks/auth_source_ldap.yml +++ b/tests/test_playbooks/tasks/auth_source_ldap.yml @@ -21,7 +21,7 @@ - 'Test Location' auth_source_ldap_organizations: - 'Test Organization' - foreman_auth_source_ldap: + auth_source_ldap: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/bookmark.yml b/tests/test_playbooks/tasks/bookmark.yml index 35d2a8d5..95ed61ca 100644 --- a/tests/test_playbooks/tasks/bookmark.yml +++ b/tests/test_playbooks/tasks/bookmark.yml @@ -6,7 +6,7 @@ bookmark_public: true bookmark_query: "started_at > 24 hours ago" bookmark_state: present - foreman_bookmark: + bookmark: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/compute_attribute.yml b/tests/test_playbooks/tasks/compute_attribute.yml index 765bdde5..46ab7990 100644 --- a/tests/test_playbooks/tasks/compute_attribute.yml +++ b/tests/test_playbooks/tasks/compute_attribute.yml @@ -4,7 +4,7 @@ - compute_profile_name: "Test Compute Profile" - compute_resource_name: "Test Compute Resource" - compute_attribute_state: "present" - foreman_compute_attribute: + compute_attribute: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/compute_profile.yml b/tests/test_playbooks/tasks/compute_profile.yml index de73586f..9f4bdc33 100644 --- a/tests/test_playbooks/tasks/compute_profile.yml +++ b/tests/test_playbooks/tasks/compute_profile.yml @@ -3,7 +3,7 @@ vars: - compute_profile_name: "Test Compute Profile" - compute_profile_state: "present" - foreman_compute_profile: + compute_profile: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/compute_resource.yml b/tests/test_playbooks/tasks/compute_resource.yml index 9b04157e..db1e85d8 100644 --- a/tests/test_playbooks/tasks/compute_resource.yml +++ b/tests/test_playbooks/tasks/compute_resource.yml @@ -2,7 +2,7 @@ - name: Create/update compute resource vars: compute_resource_name: "Test Compute Resource" - foreman_compute_resource: + compute_resource: server_url: "{{ foreman_server_url }}" username: "{{ foreman_username }}" password: "{{ foreman_password }}" diff --git a/tests/test_playbooks/tasks/config_group.yml b/tests/test_playbooks/tasks/config_group.yml index 5dc78596..c4010516 100644 --- a/tests/test_playbooks/tasks/config_group.yml +++ b/tests/test_playbooks/tasks/config_group.yml @@ -2,7 +2,7 @@ - name: "Ensure config group '{{ config_group_name }}' is '{{ config_group_state }}' }}'" vars: - config_group_name: "Test config group" - foreman_config_group: + config_group: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_credential.yml b/tests/test_playbooks/tasks/content_credential.yml index b3537e8e..c8ce023e 100644 --- a/tests/test_playbooks/tasks/content_credential.yml +++ b/tests/test_playbooks/tasks/content_credential.yml @@ -6,7 +6,7 @@ - content_credential_type: "gpg_key" - content_credential_content: "{{ lookup('file', 'data/gpg_key.asc') }}" - content_credential_state: present - katello_content_credential: + content_credential: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_view.yml b/tests/test_playbooks/tasks/content_view.yml index 3bb78834..0114d113 100644 --- a/tests/test_playbooks/tasks/content_view.yml +++ b/tests/test_playbooks/tasks/content_view.yml @@ -3,7 +3,7 @@ vars: - content_view_name: "Test Content View" - organization_name: "Test Organization" - katello_content_view: + content_view: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_view_filter_docker.yml b/tests/test_playbooks/tasks/content_view_filter_docker.yml index b717487c..97201f0b 100644 --- a/tests/test_playbooks/tasks/content_view_filter_docker.yml +++ b/tests/test_playbooks/tasks/content_view_filter_docker.yml @@ -6,7 +6,7 @@ organization_name: "Test Organization" tag: "birds" filter_state: present - katello_content_view_filter: + content_view_filter: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_view_filter_errata_date.yml b/tests/test_playbooks/tasks/content_view_filter_errata_date.yml index 05857052..524b283a 100644 --- a/tests/test_playbooks/tasks/content_view_filter_errata_date.yml +++ b/tests/test_playbooks/tasks/content_view_filter_errata_date.yml @@ -10,7 +10,7 @@ end_date: "2018-01-03" start_date: "2017-01-03" filter_state: present - katello_content_view_filter: + content_view_filter: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_view_filter_errata_id.yml b/tests/test_playbooks/tasks/content_view_filter_errata_id.yml index aa8b5ddc..c4631f4f 100644 --- a/tests/test_playbooks/tasks/content_view_filter_errata_id.yml +++ b/tests/test_playbooks/tasks/content_view_filter_errata_id.yml @@ -6,7 +6,7 @@ organization_name: "Test Organization" errata_id: RHEA-2012:0003 filter_state: present - katello_content_view_filter: + content_view_filter: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_view_filter_package.yml b/tests/test_playbooks/tasks/content_view_filter_package.yml index f32fc0d7..4fda2972 100644 --- a/tests/test_playbooks/tasks/content_view_filter_package.yml +++ b/tests/test_playbooks/tasks/content_view_filter_package.yml @@ -9,7 +9,7 @@ product: "Test Product" package_name: "bear" filter_state: present - katello_content_view_filter: + content_view_filter: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_view_filter_package_group.yml b/tests/test_playbooks/tasks/content_view_filter_package_group.yml index a86a0444..430ea618 100644 --- a/tests/test_playbooks/tasks/content_view_filter_package_group.yml +++ b/tests/test_playbooks/tasks/content_view_filter_package_group.yml @@ -6,7 +6,7 @@ organization_name: "Test Organization" package_group: "birds" filter_state: present - katello_content_view_filter: + content_view_filter: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/content_view_version.yml b/tests/test_playbooks/tasks/content_view_version.yml index cd63ac6c..037b67ba 100644 --- a/tests/test_playbooks/tasks/content_view_version.yml +++ b/tests/test_playbooks/tasks/content_view_version.yml @@ -4,7 +4,7 @@ - content_view_name: "Test Content View" - organization_name: "Test Organization" - lifecycle_environments: Library - katello_content_view_version: + content_view_version: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/domain.yml b/tests/test_playbooks/tasks/domain.yml index 7a2031fb..52244c96 100644 --- a/tests/test_playbooks/tasks/domain.yml +++ b/tests/test_playbooks/tasks/domain.yml @@ -2,7 +2,7 @@ - name: "Create/Update/Delete domain" vars: domain_state: "present" - foreman_domain: + domain: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/environment.yml b/tests/test_playbooks/tasks/environment.yml index 214fb5f7..e329cbe0 100644 --- a/tests/test_playbooks/tasks/environment.yml +++ b/tests/test_playbooks/tasks/environment.yml @@ -6,7 +6,7 @@ - "Test Location" - environment_organizations: - "Test Organization" - foreman_environment: + puppet_environment: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/external_usergroup.yml b/tests/test_playbooks/tasks/external_usergroup.yml index c0103467..b6b3322f 100644 --- a/tests/test_playbooks/tasks/external_usergroup.yml +++ b/tests/test_playbooks/tasks/external_usergroup.yml @@ -3,7 +3,7 @@ vars: external_usergroup_name: "admins" external_usergroup_state: present - foreman_external_usergroup: + external_usergroup: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/global_parameter.yml b/tests/test_playbooks/tasks/global_parameter.yml index fffd1b45..3e15cf01 100644 --- a/tests/test_playbooks/tasks/global_parameter.yml +++ b/tests/test_playbooks/tasks/global_parameter.yml @@ -5,7 +5,7 @@ global_parameter_state: present block: - name: "Ensure Global Parameter '{{ global_parameter_name }}' is {{ global_parameter_state }}" - foreman_global_parameter: + global_parameter: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/host.yml b/tests/test_playbooks/tasks/host.yml index 1c182dfd..19c03eae 100644 --- a/tests/test_playbooks/tasks/host.yml +++ b/tests/test_playbooks/tasks/host.yml @@ -1,6 +1,6 @@ --- - name: "Ensure host '{{ host_name }}' is {{ host_state }}" - foreman_host: + host: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/host_collection.yml b/tests/test_playbooks/tasks/host_collection.yml index 171e2789..ffcbc998 100644 --- a/tests/test_playbooks/tasks/host_collection.yml +++ b/tests/test_playbooks/tasks/host_collection.yml @@ -5,7 +5,7 @@ - host_collection_description: "Foo host collection for Foo servers" - host_collection_state: present - host_collection_organization: "Test Organization" - katello_host_collection: + host_collection: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/host_power.yml b/tests/test_playbooks/tasks/host_power.yml index 84b7e833..50abb7dd 100644 --- a/tests/test_playbooks/tasks/host_power.yml +++ b/tests/test_playbooks/tasks/host_power.yml @@ -1,6 +1,6 @@ --- - name: "Ensure host '{{ host_power_name }}' is {{ host_power_state }}" - foreman_host_power: + host_power: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/hostgroup.yml b/tests/test_playbooks/tasks/hostgroup.yml index 0a4235e1..a0e675f5 100644 --- a/tests/test_playbooks/tasks/hostgroup.yml +++ b/tests/test_playbooks/tasks/hostgroup.yml @@ -3,7 +3,7 @@ vars: hostgroup_name: "test_hostgroup" hostgroup_state: present - foreman_hostgroup: + hostgroup: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/image.yml b/tests/test_playbooks/tasks/image.yml index 0ccf8d1c..2be79777 100644 --- a/tests/test_playbooks/tasks/image.yml +++ b/tests/test_playbooks/tasks/image.yml @@ -3,7 +3,7 @@ vars: compute_resource_name: "Test Compute Resource" image_name: "MYIMAGE" - foreman_image: + image: server_url: "{{ foreman_server_url }}" username: "{{ foreman_username }}" password: "{{ foreman_password }}" diff --git a/tests/test_playbooks/tasks/installation_medium.yml b/tests/test_playbooks/tasks/installation_medium.yml index 6c2fb2d8..c451db1f 100644 --- a/tests/test_playbooks/tasks/installation_medium.yml +++ b/tests/test_playbooks/tasks/installation_medium.yml @@ -10,7 +10,7 @@ - "Test Organization" - installation_medium_path: "https://templeos.org/TempleOS.ISO" - installation_medium_os_family: "{{ omit }}" - foreman_installation_medium: + installation_medium: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/job_template.yml b/tests/test_playbooks/tasks/job_template.yml index f5d11088..fa47b2a7 100644 --- a/tests/test_playbooks/tasks/job_template.yml +++ b/tests/test_playbooks/tasks/job_template.yml @@ -16,7 +16,7 @@ - name: "another input" input_type: "variable" variable_name: "lolwtf" - foreman_job_template: + job_template: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/job_template_from_file.yml b/tests/test_playbooks/tasks/job_template_from_file.yml index 0dea7c83..1fceb06a 100644 --- a/tests/test_playbooks/tasks/job_template_from_file.yml +++ b/tests/test_playbooks/tasks/job_template_from_file.yml @@ -1,6 +1,6 @@ --- - name: "Ensure job template from file '{{ job_template_file_name }}' is '{{ job_template_state }}'" - foreman_job_template: + job_template: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/katello_manifest.yml b/tests/test_playbooks/tasks/katello_manifest.yml index 52479f81..5c07cdc4 100644 --- a/tests/test_playbooks/tasks/katello_manifest.yml +++ b/tests/test_playbooks/tasks/katello_manifest.yml @@ -3,11 +3,11 @@ vars: organization_name: "Test Organization" manifest_state: "present" - katello_manifest: + subscription_manifest: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" - verify_ssl: "{{ foreman_validate_certs }}" + validate_certs: "{{ foreman_validate_certs }}" organization: "{{ organization_name }}" manifest_path: "{{ manifest_path | default(omit) }}" repository_url: "{{ manifest_repository_url | default(omit) }}" diff --git a/tests/test_playbooks/tasks/katello_sync.yml b/tests/test_playbooks/tasks/katello_sync.yml index f1993b98..9abc7270 100644 --- a/tests/test_playbooks/tasks/katello_sync.yml +++ b/tests/test_playbooks/tasks/katello_sync.yml @@ -3,7 +3,7 @@ vars: organization_name: "Test Organization" product_name: "Test Product" - katello_sync: + repository_sync: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/lifecycle_environment.yml b/tests/test_playbooks/tasks/lifecycle_environment.yml index bef33445..d3f6cff3 100644 --- a/tests/test_playbooks/tasks/lifecycle_environment.yml +++ b/tests/test_playbooks/tasks/lifecycle_environment.yml @@ -3,7 +3,7 @@ vars: lifecycle_environment_name: "Dev" organization_name: "Test Organization" - katello_lifecycle_environment: + lifecycle_environment: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/location.yml b/tests/test_playbooks/tasks/location.yml index 070b2e47..cc041426 100644 --- a/tests/test_playbooks/tasks/location.yml +++ b/tests/test_playbooks/tasks/location.yml @@ -2,7 +2,7 @@ - name: "Ensure location '{{ location_name }}' is {{ location_state }}" vars: - location_name: "Test Location" - foreman_location: + location: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/model.yml b/tests/test_playbooks/tasks/model.yml index bf023445..93523ef4 100644 --- a/tests/test_playbooks/tasks/model.yml +++ b/tests/test_playbooks/tasks/model.yml @@ -3,7 +3,7 @@ vars: model_name: "acme_laptop" model_state: "present" - foreman_model: + hardware_model: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/operatingsystem.yml b/tests/test_playbooks/tasks/operatingsystem.yml index 5a103bd9..6b06a5f2 100644 --- a/tests/test_playbooks/tasks/operatingsystem.yml +++ b/tests/test_playbooks/tasks/operatingsystem.yml @@ -8,7 +8,7 @@ - operatingsystem_family: "Debian" - operatingsystem_password_hash: "SHA256" - operatingsystem_state: "present" - foreman_operatingsystem: + operatingsystem: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/organization.yml b/tests/test_playbooks/tasks/organization.yml index 8936a0d1..87785822 100644 --- a/tests/test_playbooks/tasks/organization.yml +++ b/tests/test_playbooks/tasks/organization.yml @@ -3,7 +3,7 @@ vars: - organization_name: "Test Organization" - organization_description: "A test organization" - foreman_organization: + organization: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/os_default_template.yml b/tests/test_playbooks/tasks/os_default_template.yml index 94c070df..2c3b706b 100644 --- a/tests/test_playbooks/tasks/os_default_template.yml +++ b/tests/test_playbooks/tasks/os_default_template.yml @@ -5,7 +5,7 @@ - provisioning_template_name: "Timetravel finish" - os_default_template_kind: "finish" - os_default_template_state: present - foreman_os_default_template: + os_default_template: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/product.yml b/tests/test_playbooks/tasks/product.yml index ecd9d771..3807f7b0 100644 --- a/tests/test_playbooks/tasks/product.yml +++ b/tests/test_playbooks/tasks/product.yml @@ -5,7 +5,7 @@ - product_name: "Test Product" - product_description: "A happy little test product" - product_state: present - katello_product: + product: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/provisioning_template.yml b/tests/test_playbooks/tasks/provisioning_template.yml index 8142767a..b7c292a8 100644 --- a/tests/test_playbooks/tasks/provisioning_template.yml +++ b/tests/test_playbooks/tasks/provisioning_template.yml @@ -14,7 +14,7 @@ %> cd / rm -rf * - foreman_provisioning_template: + provisioning_template: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/ptable.yml b/tests/test_playbooks/tasks/ptable.yml index a5ed71c3..81285fff 100644 --- a/tests/test_playbooks/tasks/ptable.yml +++ b/tests/test_playbooks/tasks/ptable.yml @@ -13,7 +13,7 @@ zerombr clearpart --all --initlabel autopart - foreman_ptable: + partition_table: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/realm.yml b/tests/test_playbooks/tasks/realm.yml index a35b676b..04bc7fb4 100644 --- a/tests/test_playbooks/tasks/realm.yml +++ b/tests/test_playbooks/tasks/realm.yml @@ -4,7 +4,7 @@ - realm_name: "EXAMPLE.LOCAL" - realm_proxy: "{{ foreman_proxy }}" - realm_type: "FreeIPA" - foreman_realm: + realm: server_url: "{{ foreman_server_url }}" username: "{{ foreman_username }}" password: "{{ foreman_password }}" diff --git a/tests/test_playbooks/tasks/repository.yml b/tests/test_playbooks/tasks/repository.yml index 0977cf6c..809452cc 100644 --- a/tests/test_playbooks/tasks/repository.yml +++ b/tests/test_playbooks/tasks/repository.yml @@ -6,7 +6,7 @@ repository_name: "Test Repository" repository_content_type: "yum" repository_state: present - katello_repository: + repository: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/repository_set.yml b/tests/test_playbooks/tasks/repository_set.yml index 49532214..ad15f814 100644 --- a/tests/test_playbooks/tasks/repository_set.yml +++ b/tests/test_playbooks/tasks/repository_set.yml @@ -3,7 +3,7 @@ vars: organization: Test Organization state: enabled - katello_repository_set: + repository_set: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/role.yml b/tests/test_playbooks/tasks/role.yml index 4781a733..a8b90756 100644 --- a/tests/test_playbooks/tasks/role.yml +++ b/tests/test_playbooks/tasks/role.yml @@ -8,7 +8,7 @@ role_organizations: - Test Organization role_state: present - foreman_role: + role: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/scap_content.yml b/tests/test_playbooks/tasks/scap_content.yml index 7d193daf..aff4470b 100644 --- a/tests/test_playbooks/tasks/scap_content.yml +++ b/tests/test_playbooks/tasks/scap_content.yml @@ -2,7 +2,7 @@ - name: "Create/Update/Delete SCAP content." vars: scap_content_state: "present" - foreman_scap_content: + scap_content: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/scap_tailoring_file.yml b/tests/test_playbooks/tasks/scap_tailoring_file.yml index ca55b850..7d8be3bd 100644 --- a/tests/test_playbooks/tasks/scap_tailoring_file.yml +++ b/tests/test_playbooks/tasks/scap_tailoring_file.yml @@ -2,7 +2,7 @@ - name: "Create/Update/Delete tailoring file." vars: scap_tailoring_file_state: "present" - foreman_scap_tailoring_file: + scap_tailoring_file: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/scc_account.yml b/tests/test_playbooks/tasks/scc_account.yml index 57fac57e..34525534 100644 --- a/tests/test_playbooks/tasks/scc_account.yml +++ b/tests/test_playbooks/tasks/scc_account.yml @@ -4,7 +4,7 @@ scc_account_state: "present" scc_account_name: 'Test' organization_name: 'Test Organization' - foreman_scc_account: + scc_account: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/scc_product.yml b/tests/test_playbooks/tasks/scc_product.yml index ddae8e9a..feea9bab 100644 --- a/tests/test_playbooks/tasks/scc_product.yml +++ b/tests/test_playbooks/tasks/scc_product.yml @@ -2,7 +2,7 @@ - name: "Ensure scc_product '{{ scc_product_name }}' change: {{ expected_change }} " vars: organization_name: 'Test Organization' - foreman_scc_product: + scc_product: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/search_facts.yml b/tests/test_playbooks/tasks/search_facts.yml index 7bfee86d..5ac7ea69 100644 --- a/tests/test_playbooks/tasks/search_facts.yml +++ b/tests/test_playbooks/tasks/search_facts.yml @@ -1,6 +1,6 @@ --- - name: "Find '{{ resource }}' resources" - foreman_search_facts: + resource_info: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/setting.yml b/tests/test_playbooks/tasks/setting.yml index 6d0a8427..b6525f9c 100644 --- a/tests/test_playbooks/tasks/setting.yml +++ b/tests/test_playbooks/tasks/setting.yml @@ -2,7 +2,7 @@ - name: "Ensure setting '{{ setting_name }}' is {{ setting_value | default(false) | ternary(\"'\" + (setting_value | string) | default('') + \"'\", 'undefined') }}" vars: - setting_name: 'login_text' - foreman_setting: + setting: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/setting_fact.yml b/tests/test_playbooks/tasks/setting_fact.yml index cdb87cf2..3a544cc5 100644 --- a/tests/test_playbooks/tasks/setting_fact.yml +++ b/tests/test_playbooks/tasks/setting_fact.yml @@ -1,10 +1,10 @@ --- - name: "Read setting '{{ setting_name }}'" - foreman_search_facts: + resource_info: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" - verify_ssl: "{{ foreman_validate_certs }}" + validate_certs: "{{ foreman_validate_certs }}" resource: 'settings' search: "{{ setting_name | default(omit) }}" register: result diff --git a/tests/test_playbooks/tasks/smart_class_parameter.yml b/tests/test_playbooks/tasks/smart_class_parameter.yml index dbc494bd..31925787 100644 --- a/tests/test_playbooks/tasks/smart_class_parameter.yml +++ b/tests/test_playbooks/tasks/smart_class_parameter.yml @@ -2,7 +2,7 @@ - name: "Ensure SmartClassParameter '{{ smart_class_parameter_puppetclass_name }}::{{ smart_class_parameter_parameter }}' is {{ smart_class_parameter_state }}" vars: smart_class_parameter_state: present - foreman_smart_class_parameter: + smart_class_parameter: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/snapshot.yml b/tests/test_playbooks/tasks/snapshot.yml index 56d24a41..bb023452 100644 --- a/tests/test_playbooks/tasks/snapshot.yml +++ b/tests/test_playbooks/tasks/snapshot.yml @@ -3,7 +3,7 @@ vars: snapshot_name: "ansible" snapshot_state: present - foreman_snapshot: + snapshot: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/subnet.yml b/tests/test_playbooks/tasks/subnet.yml index ee36972c..e5a3ec20 100644 --- a/tests/test_playbooks/tasks/subnet.yml +++ b/tests/test_playbooks/tasks/subnet.yml @@ -4,7 +4,7 @@ subnet_name: "Test Subnet" subnet_network: '192.168.200.0' subnet_state: present - foreman_subnet: + subnet: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/sync_plan.yml b/tests/test_playbooks/tasks/sync_plan.yml index adfeb335..02acc3de 100644 --- a/tests/test_playbooks/tasks/sync_plan.yml +++ b/tests/test_playbooks/tasks/sync_plan.yml @@ -7,7 +7,7 @@ sync_plan_enabled: false sync_plan_sync_date: "2017-01-01 00:00:00 UTC" sync_plan_state: present - katello_sync_plan: + sync_plan: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/templates_import.yml b/tests/test_playbooks/tasks/templates_import.yml index 0e83afad..a930356b 100644 --- a/tests/test_playbooks/tasks/templates_import.yml +++ b/tests/test_playbooks/tasks/templates_import.yml @@ -1,5 +1,6 @@ +--- - name: Sync templates in from a git repo - foreman_templates_import: + templates_import: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/upload.yml b/tests/test_playbooks/tasks/upload.yml index 8ed65e9a..17a50754 100644 --- a/tests/test_playbooks/tasks/upload.yml +++ b/tests/test_playbooks/tasks/upload.yml @@ -5,7 +5,7 @@ upload_src: "{{ playbook_dir }}/data/bear-4.1-1.noarch.rpm" upload_repository: "Test Repository" upload_product: "Test Product" - katello_upload: + content_upload: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/user.yml b/tests/test_playbooks/tasks/user.yml index b712c3c7..f9d57592 100644 --- a/tests/test_playbooks/tasks/user.yml +++ b/tests/test_playbooks/tasks/user.yml @@ -19,7 +19,7 @@ user_organizations: - Test Organization user_state: present - foreman_user: + user: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/tasks/usergroup.yml b/tests/test_playbooks/tasks/usergroup.yml index 2d3e8c4b..95ee260f 100644 --- a/tests/test_playbooks/tasks/usergroup.yml +++ b/tests/test_playbooks/tasks/usergroup.yml @@ -3,7 +3,7 @@ vars: usergroup_name: "testgroup" usergroup__state: present - foreman_usergroup: + usergroup: username: "{{ foreman_username }}" password: "{{ foreman_password }}" server_url: "{{ foreman_server_url }}" diff --git a/tests/test_playbooks/templates_import.yml b/tests/test_playbooks/templates_import.yml index 6ba1ac39..667e775e 100644 --- a/tests/test_playbooks/templates_import.yml +++ b/tests/test_playbooks/templates_import.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -19,6 +21,8 @@ location_state: present - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -76,6 +80,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml diff --git a/tests/test_playbooks/user.yml b/tests/test_playbooks/user.yml index 057ecc2c..19be09f7 100644 --- a/tests/test_playbooks/user.yml +++ b/tests/test_playbooks/user.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite tags: - setup gather_facts: false @@ -14,6 +16,8 @@ organization_state: "present" - hosts: tests + collections: + - redhat.satellite tags: - test gather_facts: false @@ -82,6 +86,8 @@ expected_change: false - hosts: localhost + collections: + - redhat.satellite tags: - teardown gather_facts: false diff --git a/tests/test_playbooks/usergroup.yml b/tests/test_playbooks/usergroup.yml index 1a748a00..97167a86 100644 --- a/tests/test_playbooks/usergroup.yml +++ b/tests/test_playbooks/usergroup.yml @@ -1,5 +1,7 @@ --- - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -23,6 +25,8 @@ with_items: "{{ group.roles }}" - hosts: tests + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml @@ -110,6 +114,8 @@ expected_change: true - hosts: localhost + collections: + - redhat.satellite gather_facts: false vars_files: - vars/server.yml