Skip to content

Commit

Permalink
Merge pull request #17 from RedHatSatellite/rel150
Browse files Browse the repository at this point in the history
release 1.5.0
  • Loading branch information
evgeni authored Dec 8, 2020
2 parents 07b14fe + 47e76c8 commit ac3afb0
Show file tree
Hide file tree
Showing 344 changed files with 30,384 additions and 14,147 deletions.
22 changes: 12 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,45 @@ about: Create a report to help us improve
---

##### SUMMARY
<!--- Explain the problem briefly -->
<!-- Explain the problem briefly -->


##### ISSUE TYPE
- Bug Report

##### ANSIBLE VERSION
<!--- Paste, BELOW THIS COMMENT, verbatim output from "ansible --version"-->
<!-- Paste, BELOW THIS COMMENT, verbatim output from "ansible --version"-->
```
```

##### KATELLO/FOREMAN VERSION
<!--- Paste, BELOW THIS COMMENT, verbatim output from "rpm -q tfm-rubygem-katello foreman"-->
##### COLLECTION VERSION
<!-- Paste, BELOW THIS COMMENT, verbatim output from "ansible-galaxy collection list"-->
```
```

##### APYPIE VERSION
<!--- Paste, BELOW THIS COMMENT, verbatim output from "pip show apypie | grep Version"-->
##### KATELLO/FOREMAN VERSION
<!-- Paste, BELOW THIS COMMENT, verbatim output from "rpm -q tfm-rubygem-katello foreman"-->
```
```

##### STEPS TO REPRODUCE
<!--- For bugs, show exactly how to reproduce the problem, using a minimal test-case. -->
<!-- For bugs, show exactly how to reproduce the problem, using a minimal test-case. -->

<!--- Paste example playbook below -->
<!-- Paste example playbook below -->
```yaml

```

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
<!-- What did you expect to happen when running the steps above? -->

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
<!-- What actually happened? If possible run with extra verbosity (-vvvv) and diff (--diff) -->
<!-- Please also include check mode (--check --diff) output if the API returns an error -->
<!-- Be sure to mask any sensitive information -->

<!--- Paste verbatim command output between quotes below -->
```
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "CodeQL"

on:
push:
branches:
- develop
pull_request:
branches:
- develop
schedule:
- cron: '0 6 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ['python']

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
rm -rf $(basename ${GITHUB_REF})
mv docs/_build/html $(basename ${GITHUB_REF})
git show origin/develop:docs/_gh_include/header.inc > index.html
(echo develop; dirname v*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '<div class="col-md-4 center"><a href="@@/" class="btn-doc btn"><i class="fa fa-newspaper-o"></i><p>@@</p></a></div>' >> index.html
(echo develop; dirname *.*.*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '<div class="col-md-4 center"><a href="@@/" class="btn-doc btn"><i class="fa fa-newspaper-o"></i><p>@@</p></a></div>' >> index.html
git show origin/develop:docs/_gh_include/footer.inc >> index.html
git add $(basename ${GITHUB_REF}) index.html
git commit -m "update docs for $(basename ${GITHUB_REF})" || true
Expand Down
46 changes: 33 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
matrix:
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
Expand All @@ -31,12 +30,6 @@ jobs:
ansible: "stable-2.9"
- python: "2.7"
ansible: "stable-2.10"
- python: "3.5"
ansible: "stable-2.8"
- python: "3.5"
ansible: "stable-2.9"
- python: "3.5"
ansible: "stable-2.10"
- python: "3.6"
ansible: "stable-2.8"
- python: "3.6"
Expand All @@ -55,15 +48,21 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Restore pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install libyaml-dev for PyYAML
run: sudo apt-get install -y libyaml-dev
- name: Install Ansible
run: pip install git+https://github.com/ansible/ansible.git@${{ matrix.ansible }}
run: pip install --upgrade git+https://github.com/ansible/ansible.git@${{ matrix.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
echo "COLLECTION_COMMAND=mazer" >> $GITHUB_ENV
pip install --upgrade mazer
if: matrix.ansible == 'stable-2.8'
- name: Install dependencies
run: make test-setup
Expand All @@ -90,8 +89,15 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Restore pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Ansible
run: pip install ansible
run: pip install --upgrade ansible
- name: Install dependencies
run: make test-setup
- name: Run check_mode tests
Expand All @@ -105,6 +111,13 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Restore pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: make doc-setup
- name: Build docs
Expand All @@ -123,8 +136,15 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Restore pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install flake8 yamllint
run: 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ venv/
/build/
docs/plugins/
docs/_build/
changelogs/.plugin-cache.yaml
53 changes: 53 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,59 @@ redhat.satellite Release Notes

This changelog describes changes after version 0.8.1.

v1.5.0
======

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

- content_upload - use ``to_native`` to decode RPM headers if needed (RPM 4.15+ returns strings)
- content_view_version - provide examples how to obtain detailed information about content view versions (https://bugzilla.redhat.com/show_bug.cgi?id=1868145)
- content_view_version_cleanup - new role for cleaning up unused content view versions (https://github.com/theforeman/foreman-ansible-modules/issues/497)
- host - allow management of interfaces (https://github.com/theforeman/foreman-ansible-modules/issues/757)
- inventory plugin - add support for the Report API present in Foreman 1.24 and later
- inventory plugin - allow to compose the ``inventory_hostname`` (https://github.com/theforeman/foreman-ansible-modules/issues/1070)
- manifest - new role for easier handling of subscription manifest workflows
- subnet - add new ``externalipam_group`` parameter
- update vendored ``apypie`` to 0.3.2

Bugfixes
--------

- content_upload - Fix upload of files bigger than 2MB in Pulp3-based setups (https://github.com/theforeman/foreman-ansible-modules/issues/1043)
- job_invocation - properly submit ``ssh``, ``recurrence``, ``scheduling`` and ``concurrency_control`` to the server
- repository - don't emit a false warning about ``organization_id`` not being supported by the server (https://github.com/theforeman/foreman-ansible-modules/issues/1055)
- repository_set, repository - clarify documentation which module should be used for Red Hat Repositories (https://github.com/theforeman/foreman-ansible-modules/issues/1059)

v1.4.0
======

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

- global_parameter - allow to set hidden flag (https://github.com/theforeman/foreman-ansible-modules/issues/1024)
- job_template - stricter validation of ``template_inputs`` sub-options
- redhat_manifest - allow configuring content access mode (https://github.com/theforeman/foreman-ansible-modules/issues/820)
- subnet - verify the server has the ``remote_execution`` plugin when specifying ``remote_execution_proxies``
- the ``apypie`` library is vendored inside the collection, so users only have to install ``requests`` manually now.

Bugfixes
--------

- Don't try to update an entity, if only parameters that aren't supported by the server are detected as changed. (https://github.com/theforeman/foreman-ansible-modules/issues/975)
- allow to pass an empty string when refering to entities, thus unsetting the value (https://github.com/theforeman/foreman-ansible-modules/issues/969)
- compute_profile - don't fail when trying to update compute attributes of a profile (https://github.com/theforeman/foreman-ansible-modules/issues/997)
- host, hostgroup - support ``None`` as the ``pxe_loader`` (https://github.com/theforeman/foreman-ansible-modules/issues/971)
- job_template - don't fail when trying to update template_inputs
- os_default_template - document possible template kind choices (https://bugzilla.redhat.com/show_bug.cgi?id=1889952)
- smart_class_parameters - don't fail when trying to update override_values

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

- redhat.satellite.job_invocation - Invoke Remote Execution Jobs
- redhat.satellite.smart_proxy - Manage Smart Proxies

v1.3.0
======

Expand Down
64 changes: 42 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ROLES := $(wildcard roles/*)
PLUGIN_TYPES := $(filter-out __%,$(notdir $(wildcard plugins/*)))
METADATA := galaxy.yml LICENSE README.md meta/runtime.yml requirements.txt changelogs/changelog.yaml CHANGELOG.rst
$(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))) $(foreach ROLE,$(ROLES),$(wildcard $(ROLE)/*/*))
DEPENDENCIES := $(METADATA) $(foreach PLUGIN_TYPE,$(PLUGIN_TYPES),$(_$(PLUGIN_TYPE))) $(foreach ROLE,$(ROLES),$(wildcard $(ROLE)/*/*)) $(foreach ROLE,$(ROLES),$(ROLE)/README.md)

PYTHON_VERSION = $(shell python -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')
COLLECTION_COMMAND ?= ansible-galaxy
Expand All @@ -16,28 +16,33 @@ TEST =
FLAGS =
PYTEST = pytest -n 4 --boxed -v

APIPIE_VERSION ?= v0.3.2

default: help
help:
@echo "Please use \`make <target>' where <target> is one of:"
@echo " help to show this message"
@echo " info to show infos about the collection"
@echo " lint to run code linting"
@echo " test to run unit tests"
@echo " sanity to run santy tests"
@echo " setup to set up test, lint"
@echo " test-setup to install test dependencies"
@echo " test_<test> to run a specific unittest"
@echo " record_<test> to (re-)record the server answers for a specific test"
@echo " clean_<test> to run a specific test playbook with the teardown and cleanup tags"
@echo " dist to build the collection artifact"
@echo " help to show this message"
@echo " info to show infos about the collection"
@echo " lint to run code linting"
@echo " test to run unit tests"
@echo " livetest to run test playbooks live (without vcr)"
@echo " sanity to run santy tests"
@echo " setup to set up test, lint"
@echo " test-setup to install test dependencies"
@echo " test_<test> to run a specific unittest"
@echo " livetest_<test> to run a specific unittest live (without vcr)"
@echo " record_<test> to (re-)record the server answers for a specific test"
@echo " clean_<test> to run a specific test playbook with the teardown and cleanup tags"
@echo " dist to build the collection artifact"

info:
@echo "Building collection $(NAMESPACE)-$(NAME)-$(VERSION)"
@echo " roles:\n $(foreach ROLE,$(notdir $(ROLES)), - $(ROLE)\n)"
@echo " $(foreach PLUGIN_TYPE,$(PLUGIN_TYPES), $(PLUGIN_TYPE):\n $(foreach PLUGIN,$(basename $(notdir $(_$(PLUGIN_TYPE)))), - $(PLUGIN)\n)\n)"

lint: $(MANIFEST) | tests/test_playbooks/vars/server.yml
yamllint -f parsable tests/test_playbooks
yamllint -f parsable tests/test_playbooks roles
ansible-lint -v roles/*
ansible-playbook --syntax-check tests/test_playbooks/*.yml | grep -v '^$$'
flake8 --ignore=E402,W503 --max-line-length=160 plugins/ tests/

Expand All @@ -49,20 +54,26 @@ test: $(MANIFEST) | tests/test_playbooks/vars/server.yml
$(PYTEST) $(TEST)

test-crud: $(MANIFEST) | tests/test_playbooks/vars/server.yml
$(PYTEST) 'tests/test_crud.py::test_crud'
$(PYTEST) 'tests/test_crud.py::test_crud' 'tests/test_crud.py::test_inventory'

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'

livetest: $(MANIFEST) | tests/test_playbooks/vars/server.yml
pytest -v 'tests/test_crud.py::test_crud' --vcrmode live

test_%: FORCE $(MANIFEST) | tests/test_playbooks/vars/server.yml
pytest -v 'tests/test_crud.py::test_crud[$*]' 'tests/test_crud.py::test_check_mode[$*]' $(FLAGS)

livetest_%: FORCE $(MANIFEST) | tests/test_playbooks/vars/server.yml
pytest -v 'tests/test_crud.py::test_crud[$*]' --vcrmode live $(FLAGS)

record_%: FORCE $(MANIFEST)
$(RM) tests/test_playbooks/fixtures/$*-*.yml
pytest -v 'tests/test_crud.py::test_crud[$*]' --record $(FLAGS)
pytest -v 'tests/test_crud.py::test_crud[$*]' --vcrmode record $(FLAGS)

clean_%: FORCE $(MANIFEST)
ansible-playbook --tags teardown,cleanup -i tests/inventory/hosts 'tests/test_playbooks/$*.yml'
Expand All @@ -71,7 +82,7 @@ setup: test-setup

test-setup: | tests/test_playbooks/vars/server.yml
pip install --upgrade 'pip<20'
pip install -r requirements-dev.txt
pip install --upgrade -r requirements-dev.txt

tests/test_playbooks/vars/server.yml:
cp $@.example $@
Expand Down Expand Up @@ -111,20 +122,29 @@ clean:
rm -rf build docs/plugins

doc-setup:
pip install -r docs/requirements.txt
pip install --upgrade -r docs/requirements.txt
doc: $(MANIFEST)
mkdir -p ./docs/plugins
mkdir -p ./docs/plugins ./docs/roles
cat ./docs/roles.rst.template > ./docs/roles/index.rst
for role_readme in roles/*/README.md; do \
ln -f -s ../../$$role_readme ./docs/roles/$$(basename $$(dirname $$role_readme)).md; \
echo " * :doc:\`$$(basename $$(dirname $$role_readme))\`" >> ./docs/roles/index.rst; \
done
antsibull-docs collection --use-current --squash-hierarchy --dest-dir ./docs/plugins $(NAMESPACE).$(NAME)
make -C docs html

vendor:
git clone --depth=1 --branch=$(APIPIE_VERSION) https://github.com/Apipie/apypie/ build/apypie-git
python vendor.py build/apypie-git/apypie/*.py > plugins/module_utils/_apypie.py

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 changelogs/config.yaml changelogs/changelog.yaml CHANGELOG.rst
sed -i 's/foreman.example.com/satellite.example.com/g' plugins/*/*.py
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#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
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

FORCE:

.PHONY: help dist lint sanity test test-crud test-check-mode test-other setup test-setup doc-setup doc publish FORCE
.PHONY: help dist lint sanity test test-crud test-check-mode test-other livetest setup test-setup doc-setup doc publish FORCE
Loading

0 comments on commit ac3afb0

Please sign in to comment.