Skip to content

Commit

Permalink
Merge pull request #20 from RedHatSatellite/r200
Browse files Browse the repository at this point in the history
release 2.0.1
  • Loading branch information
evgeni authored Mar 2, 2021
2 parents e92ca17 + efa1b95 commit f91152e
Show file tree
Hide file tree
Showing 144 changed files with 15,726 additions and 17,602 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
ansible:
- stable-2.8
- stable-2.9
Expand All @@ -42,14 +43,20 @@ jobs:
ansible: "stable-2.9"
- python: "3.8"
ansible: "stable-2.10"
- python: "3.9"
ansible: "stable-2.8"
- python: "3.9"
ansible: "stable-2.9"
- python: "3.9"
ansible: "stable-2.10"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Restore pip cache
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
Expand All @@ -69,7 +76,7 @@ jobs:
- name: fake redhat-uep.pem for redhat_manifest module
run: sudo mkdir -p /etc/rhsm/ca/ && sudo touch /etc/rhsm/ca/redhat-uep.pem
- name: Install required collections for ansible-base (2.10+)
run: ansible-galaxy collection install community.general
run: ansible-galaxy collection install community.docker
if: matrix.ansible == 'devel' || matrix.ansible == 'stable-2.10'
- name: Run crud tests
run: make test-crud
Expand All @@ -79,7 +86,7 @@ jobs:
run: make dist-test
- name: Run sanity tests
run: make SANITY_OPTS="--local" sanity
if: (matrix.ansible == 'devel' || matrix.ansible == 'stable-2.10') && matrix.python != '3.8'
if: matrix.ansible == 'devel' || matrix.ansible == 'stable-2.10'

checkmode:
runs-on: ubuntu-latest
Expand All @@ -90,7 +97,7 @@ jobs:
with:
python-version: "3.7"
- name: Restore pip cache
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
Expand All @@ -112,7 +119,7 @@ jobs:
with:
python-version: "3.7"
- name: Restore pip cache
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
Expand All @@ -137,14 +144,16 @@ jobs:
with:
python-version: "3.7"
- name: Restore pip cache
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install --upgrade -r requirements-lint.txt
run: |
pip install ansible
pip install --upgrade -r requirements-lint.txt
- name: Run lint
run: make lint
- name: Upload collection artifact
Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Andrew Kofink <[email protected]> <[email protected]>
Anton <[email protected]> <[email protected]>
Anton <[email protected]> <[email protected]>
Bernhard Hopfenmüller <[email protected]> <[email protected]>
Bernhard Hopfenmüller <[email protected]> <[email protected]>
Baptiste Agasse <[email protected]> <[email protected]>
Christoffer Reijer <[email protected]> <[email protected]>
Eric D. Helms <[email protected]> <[email protected]>
Expand Down
40 changes: 39 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,52 @@ redhat.satellite Release Notes

This changelog describes changes after version 0.8.1.

v1.5.1
v2.0.1
======

Bugfixes
--------

- host - don't filter ``false`` values for ``interfaces_attributes`` (https://github.com/theforeman/foreman-ansible-modules/issues/1148)
- host_info, repository_info - correctly fetch all entities when neither ``name`` nor ``search`` is set
- host_info, repository_info - enforce mutual exclusivity of ``name`` and ``search``

v2.0.0
======

Minor Changes
-------------

- Add a role `activation_keys` to manage activation keys
- Add a role `lifecycle_environments` to manage lifecycle environments
- Add a role `repositories` to manage products, repositories, and repository_sets
- Add a role `sync_plans` to manage sync plans
- activation_key - add support for selecting subscriptions by ``upstream_pool_id``
- compute_resource - add ``set_console_password``, ``keyboard_layout`` and ``public_key`` parameters (https://github.com/theforeman/foreman-ansible-modules/issues/1052)
- host - clarify that ``owner`` refers to a users login, not their full name (https://github.com/theforeman/foreman-ansible-modules/issues/1045)
- host - look up the correct network id for a network given as part of ``interfaces_attributes`` (https://github.com/theforeman/foreman-ansible-modules/issues/1104)
- host, hostgroup - add ``activation_keys`` parameter to ease configuring activation keys for deploments

Breaking Changes / Porting Guide
--------------------------------

- All role variables are now prefixed with ``foreman_`` to avoid clashes with similarly named variables from roles outside this collection.

Bugfixes
--------

- content_view_version - make the ``version`` parameter not fail when the version was entered without a minor part (https://github.com/theforeman/foreman-ansible-modules/issues/1087)
- host - allow moving hosts between Organizations and Locations (https://bugzilla.redhat.com/show_bug.cgi?id=1901716)
- host - fix subnet/domain assignment when multiple interfaces are defined (https://github.com/theforeman/foreman-ansible-modules/issues/1095)
- host, hostgroup - select kickstart_repository based on lifecycle_environment and content_view if those are set (https://github.com/theforeman/foreman-ansible-modules/issues/1090, https://bugzilla.redhat.com/1915872)
- resource_info - correctly show the exact resource when passing ``id`` in ``params``

New Modules
-----------

- redhat.satellite.host_info - Fetch information about Hosts
- redhat.satellite.puppetclasses_import - Import Puppet Classes from a Proxy
- redhat.satellite.repository_info - Fetch information about Repositories

v1.5.0
======
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ tests/test_playbooks/vars/server.yml:
@echo "For recording, please adjust $@ to match your reference server."

dist-test: $(MANIFEST)
FOREMAN_SERVER_URL=https://foreman.example.test ansible -m $(NAMESPACE).$(NAME).organization -a "username=admin password=changeme name=collectiontest" localhost | grep -q "Failed to connect to Foreman server.*foreman.example.test"
SATELLITE_SERVER_URL=https://foreman.example.test ansible -m $(NAMESPACE).$(NAME).organization -a "username=admin password=changeme name=collectiontest" localhost | grep -q "Failed to connect to Foreman server.*foreman.example.test"
ansible-doc $(NAMESPACE).$(NAME).organization | grep -q "Manage Organization"

$(MANIFEST): $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz
Expand Down Expand Up @@ -139,11 +139,16 @@ vendor:

branding:
sed -i 's/theforeman\.foreman/redhat.satellite/g' plugins/*/*.py tests/inventory/*.foreman.yml tests/test_module_state.py tests/test_playbooks/*.yml changelogs/config.yaml changelogs/changelog.yaml CHANGELOG.rst roles/*/README.md roles/*/*/*.yml docs/cvmanager.md
sed -i 's/foreman.example.com/satellite.example.com/g' plugins/*/*.py docs/cvmanager.md
sed -i 's/foreman.example.com/satellite.example.com/g' plugins/*/*.py docs/cvmanager.md roles/*/README.md roles/*/*/*.yml
sed -i 's#theforeman/foreman-ansible-modules#RedHatSatellite/satellite-ansible-collection#g' .github/workflows/*.yml
sed -i 's/theforeman-foreman/redhat-satellite/g' .github/workflows/*.yml
sed -i 's/Foreman Ansible Modules/Red Hat Satellite Ansible Collection/g' docs/index.rst docs/conf.py docs/cvmanager.md
sed -i 's/The Foreman Project/Red Hat, Inc./g' docs/conf.py
sed -i '/FOREMAN_\w/ s/FOREMAN_/SATELLITE_/g' plugins/doc_fragments/foreman.py plugins/module_utils/foreman_helper.py Makefile
sed -i '/foreman_\w/ s/foreman_/satellite_/g' roles/*/README.md roles/*/*/*.yml
sed -i '/foreman_\w.*:/ s/foreman_/satellite_/g' tests/test_playbooks/*_role.yml
rm -rf tests/test_playbooks/scc_* tests/test_playbooks/tasks/scc_* tests/test_playbooks/fixtures/scc_* plugins/modules/scc_*.py tests/fixtures/apidoc/scc_*.json
rm -rf tests/test_playbooks/snapshot* tests/test_playbooks/tasks/snapshot* tests/test_playbooks/fixtures/snapshot* plugins/modules/snapshot.py tests/fixtures/apidoc/snapshot.json

FORCE:

Expand Down
60 changes: 58 additions & 2 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,69 @@ releases:
- redhat.satellite.content_view_version_cleanup_role.yml
- redhat.satellite.manifest_role.yml
release_date: '2020-12-03'
1.5.1:
2.0.0:
changes:
breaking_changes:
- All role variables are now prefixed with ``foreman_`` to avoid clashes with
similarly named variables from roles outside this collection.
bugfixes:
- content_view_version - make the ``version`` parameter not fail when the version
was entered without a minor part (https://github.com/theforeman/foreman-ansible-modules/issues/1087)
- host - allow moving hosts between Organizations and Locations (https://bugzilla.redhat.com/show_bug.cgi?id=1901716)
- host - fix subnet/domain assignment when multiple interfaces are defined (https://github.com/theforeman/foreman-ansible-modules/issues/1095)
- host, hostgroup - select kickstart_repository based on lifecycle_environment
and content_view if those are set (https://github.com/theforeman/foreman-ansible-modules/issues/1090,
https://bugzilla.redhat.com/1915872)
- resource_info - correctly show the exact resource when passing ``id`` in ``params``
minor_changes:
- Add a role `activation_keys` to manage activation keys
- Add a role `lifecycle_environments` to manage lifecycle environments
- Add a role `repositories` to manage products, repositories, and repository_sets
- Add a role `sync_plans` to manage sync plans
- activation_key - add support for selecting subscriptions by ``upstream_pool_id``
- compute_resource - add ``set_console_password``, ``keyboard_layout`` and ``public_key``
parameters (https://github.com/theforeman/foreman-ansible-modules/issues/1052)
- host - clarify that ``owner`` refers to a users login, not their full name
(https://github.com/theforeman/foreman-ansible-modules/issues/1045)
- host - look up the correct network id for a network given as part of ``interfaces_attributes``
(https://github.com/theforeman/foreman-ansible-modules/issues/1104)
- host, hostgroup - add ``activation_keys`` parameter to ease configuring activation
keys for deploments
fragments:
- 1027-repositories_role.yml
- 1045-host-owner.yml
- 1052-compute_resource-params.yaml
- 1065-sync-plans_role.yml
- 1068-activation-keys_role.yml
- 1087-content_view_version-safenet.yml
- 1090-scope_kickstart_repository_tighter.yml
- 1095-nested_list-lookup-fix.yml
release_date: '2020-12-14'
- 1096-lifecycle-environments-role.yml
- 1104-network_id-lookup.yml
- 1145-role_prefix.yml
- 541-activation-key-upstream-pool.yml
- bz1901716-dont_scope_requests.yml
- host-hostgroup-ak-parameter.yml
- resource_info-params-id.yml
modules:
- description: Fetch information about Hosts
name: host_info
namespace: ''
- description: Import Puppet Classes from a Proxy
name: puppetclasses_import
namespace: ''
- description: Fetch information about Repositories
name: repository_info
namespace: ''
release_date: '2021-02-22'
2.0.1:
changes:
bugfixes:
- host - don't filter ``false`` values for ``interfaces_attributes`` (https://github.com/theforeman/foreman-ansible-modules/issues/1148)
- host_info, repository_info - correctly fetch all entities when neither ``name``
nor ``search`` is set
- host_info, repository_info - enforce mutual exclusivity of ``name`` and ``search``
fragments:
- 1148-dont-filter-false-params.yml
- 20210224-info_module_fixes.yml
release_date: '2021-03-02'
4 changes: 3 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ authors:
- "Christoffer Reijer <[email protected]>"
- "Deric Crago <[email protected]>"
- "Eric D. Helms <[email protected]>"
- "Eric L <[email protected]>"
- "Ethan <[email protected]>"
- "Evgeni Golov <[email protected]>"
- "Ewoud Kohl van Wijngaarden <[email protected]>"
Expand All @@ -39,6 +40,7 @@ authors:
- "Olivier <[email protected]>"
- "Ondrej Prazak <[email protected]>"
- "Ondřej Ezr <[email protected]>"
- "Patrick C. F. Ernzer <[email protected]>"
- "Patrick Creech <[email protected]>"
- "Paul Armstrong <[email protected]>"
- "Paul Gration <[email protected]>"
Expand All @@ -60,7 +62,7 @@ authors:
- "metalcated <[email protected]>"
- "russianguppie <[email protected]>"
- "willtome <[email protected]>"
version: "1.5.1"
version: "2.0.1"
license:
- "GPL-3.0-or-later"
tags:
Expand Down
47 changes: 43 additions & 4 deletions plugins/doc_fragments/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ class ModuleDocFragment(object):
server_url:
description:
- URL of the Foreman server.
- If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL) will be used instead.
- If the value is not specified in the task, the value of environment variable C(SATELLITE_SERVER_URL) will be used instead.
required: true
type: str
username:
description:
- Username accessing the Foreman server.
- If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME) will be used instead.
- If the value is not specified in the task, the value of environment variable C(SATELLITE_USERNAME) will be used instead.
required: true
type: str
password:
description:
- Password of the user accessing the Foreman server.
- If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD) will be used instead.
- If the value is not specified in the task, the value of environment variable C(SATELLITE_PASSWORD) will be used instead.
required: true
type: str
validate_certs:
description:
- Whether or not to verify the TLS certificates of the Foreman server.
- If the value is not specified in the task, the value of environment variable C(FOREMAN_VALIDATE_CERTS) will be used instead.
- If the value is not specified in the task, the value of environment variable C(SATELLITE_VALIDATE_CERTS) will be used instead.
default: true
type: bool
'''
Expand Down Expand Up @@ -270,6 +270,13 @@ class ModuleDocFragment(object):
- Only available for Katello installations.
required: false
type: str
activation_keys:
description:
- Activation Keys used for deployment.
- Comma separated list.
- Only available for Katello installations.
required: false
type: str
'''

ORGANIZATION = '''
Expand Down Expand Up @@ -318,3 +325,35 @@ class ModuleDocFragment(object):
type: str
required: False
'''

INFOMODULE = '''
options:
name:
description:
- Name of the resource to fetch information for.
- Mutually exclusive with I(search).
required: false
type: str
location:
description:
- Label of the Location to scope the search for.
required: false
type: str
organization:
description:
- Name of the Organization to scope the search for.
required: false
type: str
search:
description:
- Search query to use
- If None, and I(name) is not set, all resources are returned.
- Mutually exclusive with I(name).
type: str
'''

KATELLOINFOMODULE = '''
options:
organization:
required: true
'''
9 changes: 6 additions & 3 deletions plugins/inventory/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@
import requests
if LooseVersion(requests.__version__) < LooseVersion('1.1.0'):
raise ImportError
from requests.auth import HTTPBasicAuth
HAS_REQUESTS = True
except ImportError:
raise AnsibleError('This script requires python-requests 1.1 as a minimum version')

from requests.auth import HTTPBasicAuth
HAS_REQUESTS = False


class InventoryModule(BaseInventoryPlugin, Cacheable, Constructable):
Expand All @@ -203,6 +203,9 @@ def __init__(self):
self.cache_key = None
self.use_cache = None

if not HAS_REQUESTS:
raise AnsibleError('This script requires python-requests 1.1 as a minimum version')

def verify_file(self, path):

valid = False
Expand Down
Loading

0 comments on commit f91152e

Please sign in to comment.