1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Shippable: community/general (#12)

* Shippable: community/general
This commit is contained in:
John R Barker 2020-03-17 08:59:17 +00:00 committed by GitHub
parent fe111b8577
commit 1f06a02043
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 86 additions and 58 deletions

View file

@ -121,27 +121,6 @@ matrix:
- env: T=fallaxy/2.7/1 - env: T=fallaxy/2.7/1
- env: T=fallaxy/3.6/1 - env: T=fallaxy/3.6/1
- env: T=i/aix/7.2
- env: T=i/osx/10.11
- env: T=i/rhel/7.6
- env: T=i/rhel/8.1
- env: T=i/freebsd/11.1
- env: T=i/freebsd/12.1
- env: T=i/linux/centos6
- env: T=i/linux/centos7
- env: T=i/linux/centos8
- env: T=i/linux/fedora30
- env: T=i/linux/fedora31
- env: T=i/linux/opensuse15py2
- env: T=i/linux/opensuse15
- env: T=i/linux/ubuntu1604
- env: T=i/linux/ubuntu1804
- env: T=i/cs//1
- env: T=i/tower//1
- env: T=i/cloud//1
- env: T=i/hcloud//1
- env: T=cs/2.7/1 - env: T=cs/2.7/1
- env: T=cs/3.6/1 - env: T=cs/3.6/1
@ -154,12 +133,6 @@ matrix:
- env: T=cloud/2.7/1 - env: T=cloud/2.7/1
- env: T=cloud/3.6/1 - env: T=cloud/3.6/1
- env: T=hcloud/2.7/1
- env: T=hcloud/3.6/1
- env: T=hcloud/2.7/2
- env: T=hcloud/3.6/2
branches: branches:
except: except:
- "*-patch-*" - "*-patch-*"

View file

@ -23,7 +23,7 @@
- libapache2-mod-evasive - libapache2-mod-evasive
- name: install apache via zypper - name: install apache via zypper
package: zypper:
name: apache2 name: apache2
state: present state: present
when: "ansible_os_family == 'Suse'" when: "ansible_os_family == 'Suse'"

View file

@ -2,7 +2,7 @@
set -eux set -eux
export ANSIBLE_CALLBACK_WHITELIST="log_plays,${ANSIBLE_CALLBACK_WHITELIST:-}" export ANSIBLE_CALLBACK_WHITELIST="community.general.log_plays,${ANSIBLE_CALLBACK_WHITELIST:-}"
# run play, should create log and dir if needed # run play, should create log and dir if needed
export ANSIBLE_LOG_FOLDER="logit" export ANSIBLE_LOG_FOLDER="logit"

View file

@ -3,3 +3,4 @@ shippable/posix/group1
skip/aix skip/aix
skip/osx skip/osx
skip/freebsd skip/freebsd
disabled #fixme

View file

@ -1,2 +1,3 @@
needs/root needs/root
shippable/posix/group3 shippable/posix/group3
disabled #fixme

View file

@ -1,4 +1,4 @@
- name: Test json_query filter - name: Test json_query filter
assert: assert:
that: that:
- "users | json_query('[*].hosts[].host') == ['host_a', 'host_b', 'host_c', 'host_d']" - "users | community.general.json_query('[*].hosts[].host') == ['host_a', 'host_b', 'host_c', 'host_d']"

View file

@ -1,3 +1,4 @@
shippable/posix/group2 shippable/posix/group2
skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller
skip/aix skip/aix
disabled # fixme

View file

@ -8,7 +8,7 @@
- name: Test random_mac filter bad argument type - name: Test random_mac filter bad argument type
debug: debug:
var: "0 | random_mac" var: "0 | community.general.random_mac"
register: _bad_random_mac_filter register: _bad_random_mac_filter
ignore_errors: yes ignore_errors: yes
@ -20,7 +20,7 @@
- name: Test random_mac filter bad argument value - name: Test random_mac filter bad argument value
debug: debug:
var: "'dummy' | random_mac" var: "'dummy' | community.generalrandom_mac"
register: _bad_random_mac_filter register: _bad_random_mac_filter
ignore_errors: yes ignore_errors: yes
@ -32,7 +32,7 @@
- name: Test random_mac filter prefix too big - name: Test random_mac filter prefix too big
debug: debug:
var: "'00:00:00:00:00:00' | random_mac" var: "'00:00:00:00:00:00' | community.general.random_mac"
register: _bad_random_mac_filter register: _bad_random_mac_filter
ignore_errors: yes ignore_errors: yes
@ -55,5 +55,5 @@
- name: Verify random_mac filter with seed - name: Verify random_mac filter with seed
assert: assert:
that: that:
- "'00:00:00' | random_mac(seed='test') == '00:00:00' | random_mac(seed='test')" - "'00:00:00' | communit.general.random_mac(seed='test') == '00:00:00' | random_mac(seed='test')"
- "'00:00:00' | random_mac(seed='test') != '00:00:00' | random_mac(seed='another_test')" - "'00:00:00' | community.general.random_mac(seed='test') != '00:00:00' | random_mac(seed='another_test')"

View file

@ -1,6 +1,6 @@
shippable/posix/group2 shippable/posix/group2
destructive destructive
needs/target/setup_openssl needs/target/setup_openssl
needs/file/test/lib/ansible_test/_data/requirements/constraints.txt needs/file/tests/utils/constraints.txt
skip/aix skip/aix
skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller

View file

@ -4,7 +4,7 @@
block: block:
- name: 'Fetch secrets using "hashi_vault" lookup' - name: 'Fetch secrets using "hashi_vault" lookup'
set_fact: set_fact:
secret1: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret1 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}" secret1: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret1 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}"
secret2: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}" secret2: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}"
- name: 'Check secret values' - name: 'Check secret values'
@ -14,7 +14,7 @@
- name: 'Failure expected when erroneous credentials are used' - name: 'Failure expected when erroneous credentials are used'
vars: vars:
secret_wrong_cred: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 auth_method=approle secret_id=toto role_id=' ~ role_id) }}" secret_wrong_cred: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 auth_method=approle secret_id=toto role_id=' ~ role_id) }}"
debug: debug:
msg: 'Failure is expected ({{ secret_wrong_cred }})' msg: 'Failure is expected ({{ secret_wrong_cred }})'
register: test_wrong_cred register: test_wrong_cred
@ -22,7 +22,7 @@
- name: 'Failure expected when unauthorized secret is read' - name: 'Failure expected when unauthorized secret is read'
vars: vars:
secret_unauthorized: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret3 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}" secret_unauthorized: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret3 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}"
debug: debug:
msg: 'Failure is expected ({{ secret_unauthorized }})' msg: 'Failure is expected ({{ secret_unauthorized }})'
register: test_unauthorized register: test_unauthorized
@ -30,7 +30,7 @@
- name: 'Failure expected when inexistent secret is read' - name: 'Failure expected when inexistent secret is read'
vars: vars:
secret_inexistent: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret4 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}" secret_inexistent: "{{ lookup('community.general.:qhashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret4 auth_method=approle secret_id=' ~ secret_id ~ ' role_id=' ~ role_id) }}"
debug: debug:
msg: 'Failure is expected ({{ secret_inexistent }})' msg: 'Failure is expected ({{ secret_inexistent }})'
register: test_inexistent register: test_inexistent

View file

@ -3,12 +3,12 @@
block: block:
- name: 'Fetch secrets using "hashi_vault" lookup' - name: 'Fetch secrets using "hashi_vault" lookup'
set_fact: set_fact:
gen_secret1: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_gen_path ~ '/secret1 auth_method=token token=' ~ user_token) }}" gen_secret1: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_gen_path ~ '/secret1 auth_method=token token=' ~ user_token) }}"
gen_secret2: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_gen_path ~ '/secret2 token=' ~ user_token) }}" gen_secret2: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_gen_path ~ '/secret2 token=' ~ user_token) }}"
kv1_secret1: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv1_path ~ '/secret1 auth_method=token token=' ~ user_token) }}" kv1_secret1: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv1_path ~ '/secret1 auth_method=token token=' ~ user_token) }}"
kv1_secret2: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv1_path ~ '/secret2 token=' ~ user_token) }}" kv1_secret2: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv1_path ~ '/secret2 token=' ~ user_token) }}"
kv2_secret1: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret1 auth_method=token token=' ~ user_token) }}" kv2_secret1: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret1 auth_method=token token=' ~ user_token) }}"
kv2_secret2: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 token=' ~ user_token) }}" kv2_secret2: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 token=' ~ user_token) }}"
- name: 'Check secret generic values' - name: 'Check secret generic values'
fail: fail:
@ -27,7 +27,7 @@
- name: 'Failure expected when erroneous credentials are used' - name: 'Failure expected when erroneous credentials are used'
vars: vars:
secret_wrong_cred: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 auth_method=token token=wrong_token') }}" secret_wrong_cred: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret2 auth_method=token token=wrong_token') }}"
debug: debug:
msg: 'Failure is expected ({{ secret_wrong_cred }})' msg: 'Failure is expected ({{ secret_wrong_cred }})'
register: test_wrong_cred register: test_wrong_cred
@ -35,7 +35,7 @@
- name: 'Failure expected when unauthorized secret is read' - name: 'Failure expected when unauthorized secret is read'
vars: vars:
secret_unauthorized: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret3 token=' ~ user_token) }}" secret_unauthorized: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret3 token=' ~ user_token) }}"
debug: debug:
msg: 'Failure is expected ({{ secret_unauthorized }})' msg: 'Failure is expected ({{ secret_unauthorized }})'
register: test_unauthorized register: test_unauthorized
@ -43,7 +43,7 @@
- name: 'Failure expected when inexistent secret is read' - name: 'Failure expected when inexistent secret is read'
vars: vars:
secret_inexistent: "{{ lookup('hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret4 token=' ~ user_token) }}" secret_inexistent: "{{ lookup('community.general.hashi_vault', conn_params ~ 'secret=' ~ vault_kv2_path ~ '/secret4 token=' ~ user_token) }}"
debug: debug:
msg: 'Failure is expected ({{ secret_inexistent }})' msg: 'Failure is expected ({{ secret_inexistent }})'
register: test_inexistent register: test_inexistent

View file

@ -37,11 +37,11 @@
- name: Create a password - name: Create a password
set_fact: set_fact:
newpass: "{{ lookup('passwordstore', 'test-pass length=8 create=yes') }}" newpass: "{{ lookup('community.general.passwordstore', 'test-pass length=8 create=yes') }}"
- name: Fetch password from an existing file - name: Fetch password from an existing file
set_fact: set_fact:
readpass: "{{ lookup('passwordstore', 'test-pass') }}" readpass: "{{ lookup('community.general.passwordstore', 'test-pass') }}"
- name: Verify password - name: Verify password
assert: assert:

View file

@ -1,7 +1,7 @@
- name: postgresql_ext - install postgis - name: postgresql_ext - install postgis on Linux
package: name=postgis state=present package: name=postgis state=present
when: ansible_os_family != "Windows" when: ansible_os_family != "Windows"
- name: postgresql_ext - install postgis RedHat - name: postgresql_ext - install postgis on Windows
when: ansible_os_family == "Windows" when: ansible_os_family == "Windows"
ansible.windows.win_package: name=postgis state=present ansible.windows.win_package: name=postgis state=present
- name: postgresql_ext - create schema schema1 - name: postgresql_ext - create schema schema1

View file

@ -1,3 +1,3 @@
shippable/cloud/group1 shippable/cloud/group1
cloud/foreman cloud/foreman
needs/file/contrib/inventory/foreman.py needs/file/scripts/inventory/foreman.py

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Wrapper to use the correct Python interpreter and support code coverage. # Wrapper to use the correct Python interpreter and support code coverage.
REL_SCRIPT="../../../../contrib/inventory/foreman.py" REL_SCRIPT="../../../../scripts/inventory/foreman.py"
ABS_SCRIPT="$("${ANSIBLE_TEST_PYTHON_INTERPRETER}" -c "import os; print(os.path.abspath('${REL_SCRIPT}'))")" ABS_SCRIPT="$("${ANSIBLE_TEST_PYTHON_INTERPRETER}" -c "import os; print(os.path.abspath('${REL_SCRIPT}'))")"
# Make sure output written to current directory ends up in the temp dir. # Make sure output written to current directory ends up in the temp dir.

View file

@ -1 +1 @@
needs/file/test/lib/ansible_test/_data/requirements/constraints.txt needs/file/tests/utils/constraints.txt

View file

@ -4,5 +4,5 @@
- name: copy constraints.txt to remote host - name: copy constraints.txt to remote host
copy: copy:
src: "{{ role_path }}/../../../lib/ansible_test/_data/requirements/constraints.txt" src: "{{ role_path }}/../../../utils/constraints.txt"
dest: "{{ remote_constraints }}" dest: "{{ remote_constraints }}"

View file

@ -4,3 +4,4 @@ shippable/posix/group1
skip/aix skip/aix
skip/osx skip/osx
skip/freebsd skip/freebsd
disabled #fixme

View file

@ -0,0 +1,51 @@
coverage >= 4.2, < 5.0.0, != 4.3.2 ; python_version <= '3.7' # features in 4.2+ required, avoid known bug in 4.3.2 on python 2.6, coverage 5.0+ incompatible
coverage >= 4.5.4, < 5.0.0 ; python_version > '3.7' # coverage had a bug in < 4.5.4 that would cause unit tests to hang in Python 3.8, coverage 5.0+ incompatible
cryptography < 2.2 ; python_version < '2.7' # cryptography 2.2 drops support for python 2.6
deepdiff < 4.0.0 ; python_version < '3' # deepdiff 4.0.0 and later require python 3
jinja2 < 2.11 ; python_version < '2.7' # jinja2 2.11 and later require python 2.7 or later
urllib3 < 1.24 ; python_version < '2.7' # urllib3 1.24 and later require python 2.7 or later
pywinrm >= 0.3.0 # message encryption support
sphinx < 1.6 ; python_version < '2.7' # sphinx 1.6 and later require python 2.7 or later
sphinx < 1.8 ; python_version >= '2.7' # sphinx 1.8 and later are currently incompatible with rstcheck 3.3
pygments >= 2.4.0 # Pygments 2.4.0 includes bugfixes for YAML and YAML+Jinja lexers
wheel < 0.30.0 ; python_version < '2.7' # wheel 0.30.0 and later require python 2.7 or later
yamllint != 1.8.0, < 1.14.0 ; python_version < '2.7' # yamllint 1.8.0 and 1.14.0+ require python 2.7+
pycrypto >= 2.6 # Need features found in 2.6 and greater
ncclient >= 0.5.2 # Need features added in 0.5.2 and greater
idna < 2.6, >= 2.5 # linode requires idna < 2.9, >= 2.5, requests requires idna < 2.6, but cryptography will cause the latest version to be installed instead
paramiko < 2.4.0 ; python_version < '2.7' # paramiko 2.4.0 drops support for python 2.6
pytest < 3.3.0 ; python_version < '2.7' # pytest 3.3.0 drops support for python 2.6
pytest < 5.0.0 ; python_version == '2.7' # pytest 5.0.0 and later will no longer support python 2.7
pytest-forked < 1.0.2 ; python_version < '2.7' # pytest-forked 1.0.2 and later require python 2.7 or later
pytest-forked >= 1.0.2 ; python_version >= '2.7' # pytest-forked before 1.0.2 does not work with pytest 4.2.0+ (which requires python 2.7+)
ntlm-auth >= 1.3.0 # message encryption support using cryptography
requests < 2.20.0 ; python_version < '2.7' # requests 2.20.0 drops support for python 2.6
requests-ntlm >= 1.1.0 # message encryption support
requests-credssp >= 0.1.0 # message encryption support
voluptuous >= 0.11.0 # Schema recursion via Self
openshift >= 0.6.2, < 0.9.0 # merge_type support
virtualenv < 16.0.0 ; python_version < '2.7' # virtualenv 16.0.0 and later require python 2.7 or later
pathspec < 0.6.0 ; python_version < '2.7' # pathspec 0.6.0 and later require python 2.7 or later
pyopenssl < 18.0.0 ; python_version < '2.7' # pyOpenSSL 18.0.0 and later require python 2.7 or later
pyfmg == 0.6.1 # newer versions do not pass current unit tests
pyyaml < 5.1 ; python_version < '2.7' # pyyaml 5.1 and later require python 2.7 or later
pycparser < 2.19 ; python_version < '2.7' # pycparser 2.19 and later require python 2.7 or later
mock >= 2.0.0 # needed for features backported from Python 3.6 unittest.mock (assert_called, assert_called_once...)
pytest-mock >= 1.4.0 # needed for mock_use_standalone_module pytest option
xmltodict < 0.12.0 ; python_version < '2.7' # xmltodict 0.12.0 and later require python 2.7 or later
lxml < 4.3.0 ; python_version < '2.7' # lxml 4.3.0 and later require python 2.7 or later
pyvmomi < 6.0.0 ; python_version < '2.7' # pyvmomi 6.0.0 and later require python 2.7 or later
pyone == 1.1.9 # newer versions do not pass current integration tests
boto3 < 1.11 ; python_version < '2.7' # boto3 1.11 drops Python 2.6 support
botocore >= 1.10.0, < 1.14 ; python_version < '2.7' # adds support for the following AWS services: secretsmanager, fms, and acm-pca; botocore 1.14 drops Python 2.6 support
botocore >= 1.10.0 ; python_version >= '2.7' # adds support for the following AWS services: secretsmanager, fms, and acm-pca
setuptools < 45 ; python_version <= '2.7' # setuptools 45 and later require python 3.5 or later
# freeze pylint and its requirements for consistent test results
astroid == 2.2.5
isort == 4.3.15
lazy-object-proxy == 1.3.1
mccabe == 0.6.1
pylint == 2.3.1
typed-ast == 1.4.0 # 1.4.0 is required to compile on Python 3.8
wrapt == 1.11.1

View file

@ -77,7 +77,7 @@ set -ux
pip install git+https://github.com/ansible/ansible.git@temp-2.10-devel --disable-pip-version-check pip install git+https://github.com/ansible/ansible.git@temp-2.10-devel --disable-pip-version-check
COLLECTION_DIR="${HOME}/.ansible/ansible_collections/" COLLECTION_DIR="${HOME}/.ansible/ansible_collections/"
TEST_DIR="${COLLECTION_DIR}/ansible/posix" TEST_DIR="${COLLECTION_DIR}/community/general"
mkdir -p "${TEST_DIR}" mkdir -p "${TEST_DIR}"
cp -aT "${SHIPPABLE_BUILD_DIR}" "${TEST_DIR}" cp -aT "${SHIPPABLE_BUILD_DIR}" "${TEST_DIR}"
cd "${TEST_DIR}" cd "${TEST_DIR}"