Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Testing with ansible-core
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
fao89 committed Mar 23, 2021
1 parent 5101298 commit d12cce2
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,50 @@ jobs:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
shell: bash
core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install prerequisites
run: |
pip install --upgrade pip
sudo apt remove ansible
pip install --pre ansible-core
pip install molecule docker molecule-docker ansible-lint[yamllint]
ansible-galaxy collection install --force community.general -p ./temp
ansible-galaxy collection install --force community.crypto -p ./temp
mkdir -p plugins/modules
cp temp/ansible_collections/community/general/plugins/modules/files/ini_file.py plugins/modules
cp temp/ansible_collections/community/general/plugins/modules/system/seport.py plugins/modules
cp temp/ansible_collections/community/crypto/plugins/modules/openssl_privatekey.py plugins/modules
cp temp/ansible_collections/community/crypto/plugins/modules/openssl_publickey.py plugins/modules
rm -rf temp
make install
mkdir -p ~/.ansible/collections/ansible_collections/pulp/pulp_installer
ansible-galaxy collection install --force community.docker
MOLECULE_PATH=$(pip show molecule | grep Location | cut -d' ' -f2)
sed -i "/tasks:/i collections:" $MOLECULE_PATH/molecule_docker/playbooks/create.yml
sed -i "/collections:/a - community.docker" $MOLECULE_PATH/molecule_docker/playbooks/create.yml
sed -i "s/collections:/ collections:/g" $MOLECULE_PATH/molecule_docker/playbooks/create.yml
sed -i "s/- community.docker/ - community.docker/g" $MOLECULE_PATH/molecule_docker/playbooks/create.yml
cp -r ./build/collections/ansible_collections/pulp/pulp_installer/* ~/.ansible/collections/ansible_collections/pulp/pulp_installer
sed -i "/roles:/i collections:" playbooks/example-source/playbook.yml
sed -i "/collections:/a - pulp.pulp_installer" playbooks/example-source/playbook.yml
sed -i "s/collections:/ collections:/g" playbooks/example-source/playbook.yml
sed -i "s/- pulp.pulp_installer/ - pulp.pulp_installer/g" playbooks/example-source/playbook.yml
ansible-galaxy collection install --requirements-file requirements.yml
- name: Molecule
run: |
ansible --version
molecule test --scenario-name source-static
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
shell: bash
vagrant:
runs-on: ubuntu-20.04
strategy:
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ MANIFEST := build/collections/ansible_collections/$(NAMESPACE)/$(NAME)/MANIFEST.

ROLES := $(wildcard roles/*)
DOCS := $(wildcard docs/*/*) $(wildcard docs/*)
PLUGINS := $(wildcard plugins/*/*) $(wildcard plugins/*)
META := $(wildcard meta/*)
PLAYBOOKS := $(wildcard playbooks/*/*/*) $(wildcard playbooks/*/*) $(wildcard playbooks/*)
METADATA := galaxy.yml COPYRIGHT LICENSE README.md requirements.yml
DEPENDENCIES := $(METADATA) $(foreach ROLE,$(ROLES),$(wildcard $(ROLE)/*/*)) $(foreach ROLE,$(ROLES),$(ROLE)/README.md) $(META) $(DOCS) $(PLAYBOOKS)
DEPENDENCIES := $(METADATA) $(foreach ROLE,$(ROLES),$(wildcard $(ROLE)/*/*)) $(foreach ROLE,$(ROLES),$(ROLE)/README.md) $(META) $(DOCS) $(PLAYBOOKS) $(PLUGINS)

MOLECULE_SCENARIO ?= release-static
TOX_ENV ?= py37-ansible2.9-$(MOLECULE_SCENARIO)
Expand Down
4 changes: 0 additions & 4 deletions molecule/source-static/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ platforms:
name: centos-8
image: pulp/molecule_centos8
command: /sbin/init
- <<: *platform_base
name: debian-10
image: pulp/molecule_debian10
command: /sbin/init
- <<: *platform_base
name: fedora-33
image: pulp/molecule_fedora33
Expand Down
2 changes: 2 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ roles:
- geerlingguy.postgresql
collections:
- ansible.posix
- community.postgresql
- community.crypto
2 changes: 2 additions & 0 deletions roles/pulp_api/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ galaxy_info:
- pulpcore
dependencies:
- pulp_common
collections:
- community.crypto
2 changes: 2 additions & 0 deletions roles/pulp_database/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ galaxy_info:
- pulp
- pulpcore
dependencies: []
collections:
- community.postgresql
1 change: 1 addition & 0 deletions roles/pulp_webserver/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ dependencies:
- pulp_common
collections:
- ansible.posix
- community.crypto

0 comments on commit d12cce2

Please sign in to comment.