Merge branch 'master' into become_chdir
commit
9fffb6c2f2
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import ci_lib
|
|
||||||
|
|
||||||
batches = [
|
|
||||||
[
|
|
||||||
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
ci_lib.run_batches(batches)
|
|
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import ci_lib
|
|
||||||
|
|
||||||
batches = [
|
|
||||||
]
|
|
||||||
|
|
||||||
ci_lib.run_batches(batches)
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import ci_lib
|
|
||||||
|
|
||||||
batches = [
|
|
||||||
]
|
|
||||||
|
|
||||||
if ci_lib.have_docker():
|
|
||||||
batches.append([
|
|
||||||
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
ci_lib.run_batches(batches)
|
|
@ -0,0 +1,326 @@
|
|||||||
|
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||||
|
|
||||||
|
name: Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- docs-master
|
||||||
|
|
||||||
|
env:
|
||||||
|
#ANSIBLE_VERBOSITY: 3
|
||||||
|
#MITOGEN_LOG_LEVEL: DEBUG
|
||||||
|
MITOGEN_TEST_IMAGE_TEMPLATE: "ghcr.io/mitogen-hq/%(distro)s-test"
|
||||||
|
|
||||||
|
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
|
||||||
|
# https://github.com/actions/runner-images/blob/main/README.md#software-and-image-support
|
||||||
|
jobs:
|
||||||
|
linux:
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: Ans_27_210
|
||||||
|
tox_env: py27-mode_ansible-ansible2.10
|
||||||
|
- name: Ans_27_4
|
||||||
|
tox_env: py27-mode_ansible-ansible4
|
||||||
|
|
||||||
|
- name: Ans_36_210
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_ansible-ansible2.10
|
||||||
|
- name: Ans_36_4
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_ansible-ansible4
|
||||||
|
|
||||||
|
- name: Ans_311_210
|
||||||
|
python_version: '3.11'
|
||||||
|
tox_env: py311-mode_ansible-ansible2.10
|
||||||
|
- name: Ans_311_3
|
||||||
|
python_version: '3.11'
|
||||||
|
tox_env: py311-mode_ansible-ansible3
|
||||||
|
- name: Ans_311_4
|
||||||
|
python_version: '3.11'
|
||||||
|
tox_env: py311-mode_ansible-ansible4
|
||||||
|
- name: Ans_311_5
|
||||||
|
python_version: '3.11'
|
||||||
|
tox_env: py311-mode_ansible-ansible5
|
||||||
|
- name: Ans_312_6
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_ansible-ansible6
|
||||||
|
- name: Ans_312_7
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_ansible-ansible7
|
||||||
|
- name: Ans_312_8
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_ansible-ansible8
|
||||||
|
- name: Ans_312_9
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_ansible-ansible9
|
||||||
|
- name: Ans_312_10
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_ansible-ansible10
|
||||||
|
- name: Van_312_10
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_ansible-ansible10-strategy_linear
|
||||||
|
|
||||||
|
- name: Mito_27_centos6
|
||||||
|
tox_env: py27-mode_mitogen-distro_centos6
|
||||||
|
- name: Mito_27_centos7
|
||||||
|
tox_env: py27-mode_mitogen-distro_centos7
|
||||||
|
- name: Mito_27_centos8
|
||||||
|
tox_env: py27-mode_mitogen-distro_centos8
|
||||||
|
- name: Mito_27_debian9
|
||||||
|
tox_env: py27-mode_mitogen-distro_debian9
|
||||||
|
- name: Mito_27_debian10
|
||||||
|
tox_env: py27-mode_mitogen-distro_debian10
|
||||||
|
- name: Mito_27_debian11
|
||||||
|
tox_env: py27-mode_mitogen-distro_debian11
|
||||||
|
- name: Mito_27_ubuntu1604
|
||||||
|
tox_env: py27-mode_mitogen-distro_ubuntu1604
|
||||||
|
- name: Mito_27_ubuntu1804
|
||||||
|
tox_env: py27-mode_mitogen-distro_ubuntu1804
|
||||||
|
- name: Mito_27_ubuntu2004
|
||||||
|
tox_env: py27-mode_mitogen-distro_ubuntu2004
|
||||||
|
|
||||||
|
- name: Mito_36_centos6
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_centos6
|
||||||
|
- name: Mito_36_centos7
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_centos7
|
||||||
|
- name: Mito_36_centos8
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_centos8
|
||||||
|
- name: Mito_36_debian9
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_debian9
|
||||||
|
- name: Mito_36_debian10
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_debian10
|
||||||
|
- name: Mito_36_debian11
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_debian11
|
||||||
|
- name: Mito_36_ubuntu1604
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_ubuntu1604
|
||||||
|
- name: Mito_36_ubuntu1804
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_ubuntu1804
|
||||||
|
- name: Mito_36_ubuntu2004
|
||||||
|
python_version: '3.6'
|
||||||
|
tox_env: py36-mode_mitogen-distro_ubuntu2004
|
||||||
|
|
||||||
|
- name: Mito_312_centos6
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_centos6
|
||||||
|
- name: Mito_312_centos7
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_centos7
|
||||||
|
- name: Mito_312_centos8
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_centos8
|
||||||
|
- name: Mito_312_debian9
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_debian9
|
||||||
|
- name: Mito_312_debian10
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_debian10
|
||||||
|
- name: Mito_312_debian11
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_debian11
|
||||||
|
- name: Mito_312_ubuntu1604
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_ubuntu1604
|
||||||
|
- name: Mito_312_ubuntu1804
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_ubuntu1804
|
||||||
|
- name: Mito_312_ubuntu2004
|
||||||
|
python_version: '3.12'
|
||||||
|
tox_env: py312-mode_mitogen-distro_ubuntu2004
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python_version }}
|
||||||
|
if: ${{ matrix.python_version }}
|
||||||
|
- uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Install build deps
|
||||||
|
run: |
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y python2-dev python3-pip virtualenv
|
||||||
|
- name: Show Python versions
|
||||||
|
run: |
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
|
# macOS builders lack a realpath command
|
||||||
|
type python && python -c"import os.path;print(os.path.realpath('$(type -p python)'))" && python --version
|
||||||
|
type python2 && python2 -c"import os.path;print(os.path.realpath('$(type -p python2)'))" && python2 --version
|
||||||
|
type python3 && python3 -c"import os.path;print(os.path.realpath('$(type -p python3)'))" && python3 --version
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [ -e /usr/bin/python ]; then
|
||||||
|
echo "/usr/bin/python: sys.executable: $(/usr/bin/python -c 'import sys; print(sys.executable)')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e /usr/bin/python2 ]; then
|
||||||
|
echo "/usr/bin/python2: sys.executable: $(/usr/bin/python2 -c 'import sys; print(sys.executable)')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e /usr/bin/python2.7 ]; then
|
||||||
|
echo "/usr/bin/python2.7: sys.executable: $(/usr/bin/python2.7 -c 'import sys; print(sys.executable)')"
|
||||||
|
fi
|
||||||
|
- name: Install tooling
|
||||||
|
run: |
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
|
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
|
||||||
|
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "${{ matrix.tox_env }}"))')
|
||||||
|
|
||||||
|
if [[ -z $PYTHON ]]; then
|
||||||
|
echo 1>&2 "Python interpreter could not be determined"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $PYTHON == "python2.7" && $(uname) == "Darwin" ]]; then
|
||||||
|
"$PYTHON" -m ensurepip --user --altinstall --no-default-pip
|
||||||
|
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
|
||||||
|
elif [[ $PYTHON == "python2.7" ]]; then
|
||||||
|
curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" --output "get-pip.py"
|
||||||
|
"$PYTHON" get-pip.py --user --no-python-version-warning
|
||||||
|
# Avoid Python 2.x pip masking system pip
|
||||||
|
rm -f ~/.local/bin/{easy_install,pip,wheel}
|
||||||
|
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
|
||||||
|
else
|
||||||
|
"$PYTHON" -m pip install -r "tests/requirements-tox.txt"
|
||||||
|
fi
|
||||||
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
GITHUB_ACTOR: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
|
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
|
||||||
|
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "${{ matrix.tox_env }}"))')
|
||||||
|
|
||||||
|
if [[ -z $PYTHON ]]; then
|
||||||
|
echo 1>&2 "Python interpreter could not be determined"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$PYTHON" -m tox -e "${{ matrix.tox_env }}"
|
||||||
|
|
||||||
|
macos:
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
|
||||||
|
runs-on: macos-12
|
||||||
|
timeout-minutes: 120
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: Mito_27
|
||||||
|
tox_env: py27-mode_mitogen
|
||||||
|
- name: Mito_312
|
||||||
|
tox_env: py312-mode_mitogen
|
||||||
|
|
||||||
|
- name: Loc_27_210
|
||||||
|
tox_env: py27-mode_localhost-ansible2.10
|
||||||
|
- name: Loc_312_10
|
||||||
|
tox_env: py312-mode_localhost-ansible10
|
||||||
|
|
||||||
|
- name: Van_27_210
|
||||||
|
tox_env: py27-mode_localhost-ansible2.10-strategy_linear
|
||||||
|
- name: Van_312_10
|
||||||
|
tox_env: py312-mode_localhost-ansible10-strategy_linear
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python_version }}
|
||||||
|
if: ${{ matrix.python_version }}
|
||||||
|
- name: Show Python versions
|
||||||
|
run: |
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
|
# macOS builders lack a realpath command
|
||||||
|
type python && python -c"import os.path;print(os.path.realpath('$(type -p python)'))" && python --version
|
||||||
|
type python2 && python2 -c"import os.path;print(os.path.realpath('$(type -p python2)'))" && python2 --version
|
||||||
|
type python3 && python3 -c"import os.path;print(os.path.realpath('$(type -p python3)'))" && python3 --version
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [ -e /usr/bin/python ]; then
|
||||||
|
echo "/usr/bin/python: sys.executable: $(/usr/bin/python -c 'import sys; print(sys.executable)')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e /usr/bin/python2 ]; then
|
||||||
|
echo "/usr/bin/python2: sys.executable: $(/usr/bin/python2 -c 'import sys; print(sys.executable)')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e /usr/bin/python2.7 ]; then
|
||||||
|
echo "/usr/bin/python2.7: sys.executable: $(/usr/bin/python2.7 -c 'import sys; print(sys.executable)')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ]; then
|
||||||
|
# GitHub macOS 12 images: python2.7 is installed, but not on $PATH
|
||||||
|
echo "/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7: sys.executable: $(/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 -c 'import sys; print(sys.executable)')"
|
||||||
|
fi
|
||||||
|
- name: Install tooling
|
||||||
|
run: |
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
|
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
|
||||||
|
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "${{ matrix.tox_env }}"))')
|
||||||
|
|
||||||
|
if [[ -z $PYTHON ]]; then
|
||||||
|
echo 1>&2 "Python interpreter could not be determined"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $PYTHON == "python2.7" && $(uname) == "Darwin" ]]; then
|
||||||
|
# GitHub macOS 12 images: python2.7 is installed, but not on $PATH
|
||||||
|
PYTHON="/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7"
|
||||||
|
"$PYTHON" -m ensurepip --user --altinstall --no-default-pip
|
||||||
|
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
|
||||||
|
elif [[ $PYTHON == "python2.7" ]]; then
|
||||||
|
curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" --output "get-pip.py"
|
||||||
|
"$PYTHON" get-pip.py --user --no-python-version-warning
|
||||||
|
# Avoid Python 2.x pip masking system pip
|
||||||
|
rm -f ~/.local/bin/{easy_install,pip,wheel}
|
||||||
|
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
|
||||||
|
else
|
||||||
|
"$PYTHON" -m pip install -r "tests/requirements-tox.txt"
|
||||||
|
fi
|
||||||
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
GITHUB_ACTOR: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
|
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
|
||||||
|
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "${{ matrix.tox_env }}"))')
|
||||||
|
|
||||||
|
if [[ -z $PYTHON ]]; then
|
||||||
|
echo 1>&2 "Python interpreter could not be determined"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $PYTHON == "python2.7" && $(uname) == "Darwin" ]]; then
|
||||||
|
# GitHub macOS 12 images: python2.7 is installed, but not on $PATH
|
||||||
|
PYTHON="/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$PYTHON" -m tox -e "${{ matrix.tox_env }}"
|
@ -1,14 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<title>Mitogen for Ansible (Redirect)</title>
|
|
||||||
<script>
|
|
||||||
{% include "piwik-config.js" %}
|
|
||||||
var u="https://networkgenomics.com/p/tr/";
|
|
||||||
_paq.push(['setTrackerUrl', u+'ep']);
|
|
||||||
</script>
|
|
||||||
<script src="https://networkgenomics.com/p/tr/js"></script>
|
|
||||||
<script>
|
|
||||||
setTimeout(function() {
|
|
||||||
window.location = 'https://networkgenomics.com/ansible/';
|
|
||||||
}, 0);
|
|
||||||
</script>
|
|
||||||
<meta http-equiv="Refresh" content="0; url=https://networkgenomics.com/ansible/">
|
|
@ -1,5 +0,0 @@
|
|||||||
window._paq = [];
|
|
||||||
window._paq.push(['trackPageView']);
|
|
||||||
window._paq.push(['enableLinkTracking']);
|
|
||||||
window._paq.push(['enableHeartBeatTimer', 30]);
|
|
||||||
window._paq.push(['setSiteId', 6]);
|
|
@ -1,6 +1,9 @@
|
|||||||
# code: language=ini
|
# code: language=ini
|
||||||
# vim: syntax=dosini
|
# vim: syntax=dosini
|
||||||
|
|
||||||
|
[become_same_user]
|
||||||
# become_same_user.yml
|
# become_same_user.yml
|
||||||
bsu-joe ansible_user=joe
|
bsu-joe ansible_user=joe
|
||||||
|
|
||||||
|
[become_same_user:vars]
|
||||||
|
ansible_python_interpreter=python3000
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
---
|
---
|
||||||
pkg_mgr_python_interpreter: python
|
pkg_mgr_python_interpreter: python
|
||||||
|
pkg_repos_overrides: []
|
||||||
|
@ -1,2 +1,28 @@
|
|||||||
---
|
---
|
||||||
pkg_mgr_python_interpreter: /usr/libexec/platform-python
|
pkg_mgr_python_interpreter: /usr/libexec/platform-python
|
||||||
|
|
||||||
|
pkg_repos_overrides:
|
||||||
|
- dest: /etc/yum.repos.d/CentOS-Linux-AppStream.repo
|
||||||
|
content: |
|
||||||
|
[appstream]
|
||||||
|
name=CentOS Linux $releasever - AppStream
|
||||||
|
baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||||
|
- dest: /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
|
||||||
|
content: |
|
||||||
|
[baseos]
|
||||||
|
name=CentOS Linux $releasever - BaseOS
|
||||||
|
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||||
|
- dest: /etc/yum.repos.d/CentOS-Linux-Extras.repo
|
||||||
|
content: |
|
||||||
|
[extras]
|
||||||
|
name=CentOS Linux $releasever - Extras
|
||||||
|
baseurl=http://vault.centos.org/$contentdir/$releasever/extras/$basearch/os/
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
pkg_repos_overrides:
|
||||||
|
- dest: /etc/apt/sources.list
|
||||||
|
content: |
|
||||||
|
deb http://archive.debian.org/debian stretch main contrib non-free
|
@ -1,92 +1,94 @@
|
|||||||
# Verify copy module for small and large files, and inline content.
|
# Verify copy module for small and large files, and inline content.
|
||||||
|
# To exercise https://github.com/mitogen-hq/mitogen/pull/1110 destination
|
||||||
|
# files must have extensions and loops must use `with_items:`.
|
||||||
|
|
||||||
- name: integration/action/copy.yml
|
- name: integration/action/copy.yml
|
||||||
hosts: test-targets
|
hosts: test-targets
|
||||||
tasks:
|
vars:
|
||||||
- name: Create tiny file
|
sourced_files:
|
||||||
copy:
|
- src: /tmp/copy-tiny-file
|
||||||
dest: /tmp/copy-tiny-file
|
dest: /tmp/copy-tiny-file.out
|
||||||
content:
|
content: this is a tiny file.
|
||||||
this is a tiny file.
|
expected_checksum: f29faa9a6f19a700a941bf2aa5b281643c4ec8a0
|
||||||
delegate_to: localhost
|
- src: /tmp/copy-large-file
|
||||||
run_once: true
|
dest: /tmp/copy-large-file.out
|
||||||
|
content: "{{ 'x' * 200000 }}"
|
||||||
|
expected_checksum: 62951f943c41cdd326e5ce2b53a779e7916a820d
|
||||||
|
|
||||||
|
inline_files:
|
||||||
|
- dest: /tmp/copy-tiny-inline-file.out
|
||||||
|
content: tiny inline content
|
||||||
|
expected_checksum: b26dd6444595e2bdb342aa0a91721b57478b5029
|
||||||
|
- dest: /tmp/copy-large-inline-file.out
|
||||||
|
content: |
|
||||||
|
{{ 'y' * 200000 }}
|
||||||
|
expected_checksum: d675f47e467eae19e49032a2cc39118e12a6ee72
|
||||||
|
|
||||||
- name: Create large file
|
files: "{{ sourced_files + inline_files }}"
|
||||||
|
tasks:
|
||||||
|
- name: Create sourced files
|
||||||
copy:
|
copy:
|
||||||
dest: /tmp/copy-large-file
|
dest: "{{ item.src }}"
|
||||||
# Must be larger than Connection.SMALL_SIZE_LIMIT.
|
content: "{{ item.content }}"
|
||||||
content: "{% for x in range(200000) %}x{% endfor %}"
|
mode: u=rw,go=r
|
||||||
|
with_items: "{{ sourced_files }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.src }}"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- name: Cleanup copied files
|
- name: Cleanup lingering destination files
|
||||||
file:
|
file:
|
||||||
|
path: "{{ item.dest }}"
|
||||||
state: absent
|
state: absent
|
||||||
path: "{{item}}"
|
with_items: "{{ files }}"
|
||||||
with_items:
|
loop_control:
|
||||||
- /tmp/copy-tiny-file.out
|
label: "{{ item.dest }}"
|
||||||
- /tmp/copy-large-file.out
|
|
||||||
- /tmp/copy-tiny-inline-file.out
|
|
||||||
- /tmp/copy-large-inline-file.out
|
|
||||||
|
|
||||||
- name: Copy large file
|
- name: Copy sourced files
|
||||||
copy:
|
copy:
|
||||||
dest: /tmp/copy-large-file.out
|
src: "{{ item.src }}"
|
||||||
src: /tmp/copy-large-file
|
dest: "{{ item.dest }}"
|
||||||
|
mode: u=rw,go=r
|
||||||
- name: Copy tiny file
|
with_items: "{{ sourced_files }}"
|
||||||
copy:
|
loop_control:
|
||||||
dest: /tmp/copy-tiny-file.out
|
label: "{{ item.dest }}"
|
||||||
src: /tmp/copy-tiny-file
|
|
||||||
|
|
||||||
- name: Copy tiny inline file
|
- name: Copy inline files
|
||||||
copy:
|
copy:
|
||||||
dest: /tmp/copy-tiny-inline-file.out
|
dest: "{{ item.dest }}"
|
||||||
content: "tiny inline content"
|
content: "{{ item.content }}"
|
||||||
|
mode: u=rw,go=r
|
||||||
- name: Copy large inline file
|
with_items: "{{ inline_files }}"
|
||||||
copy:
|
loop_control:
|
||||||
dest: /tmp/copy-large-inline-file.out
|
label: "{{ item.dest }}"
|
||||||
content: |
|
|
||||||
{% for x in range(200000) %}y{% endfor %}
|
|
||||||
|
|
||||||
# stat results
|
# stat results
|
||||||
|
|
||||||
- name: Stat copied files
|
- name: Stat copied files
|
||||||
stat:
|
stat:
|
||||||
path: "{{item}}"
|
path: "{{ item.dest }}"
|
||||||
with_items:
|
with_items: "{{ files }}"
|
||||||
- /tmp/copy-tiny-file.out
|
loop_control:
|
||||||
- /tmp/copy-large-file.out
|
label: "{{ item.dest }}"
|
||||||
- /tmp/copy-tiny-inline-file.out
|
|
||||||
- /tmp/copy-large-inline-file.out
|
|
||||||
register: stat
|
register: stat
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- stat.results[0].stat.checksum == "f29faa9a6f19a700a941bf2aa5b281643c4ec8a0"
|
- item.stat.checksum == item.item.expected_checksum
|
||||||
- stat.results[1].stat.checksum == "62951f943c41cdd326e5ce2b53a779e7916a820d"
|
quiet: true # Avoid spamming stdout with 400 kB of item.item.content
|
||||||
- stat.results[2].stat.checksum == "b26dd6444595e2bdb342aa0a91721b57478b5029"
|
fail_msg: item={{ item }}
|
||||||
- stat.results[3].stat.checksum == "d675f47e467eae19e49032a2cc39118e12a6ee72"
|
with_items: "{{ stat.results }}"
|
||||||
fail_msg: stat={{stat}}
|
loop_control:
|
||||||
|
label: "{{ item.stat.path }}"
|
||||||
|
|
||||||
- name: Cleanup files
|
- name: Cleanup destination files
|
||||||
file:
|
file:
|
||||||
|
path: "{{ item.dest }}"
|
||||||
state: absent
|
state: absent
|
||||||
path: "{{item}}"
|
with_items: "{{ files }}"
|
||||||
with_items:
|
loop_control:
|
||||||
- /tmp/copy-tiny-file
|
label: "{{ item.dest }}"
|
||||||
- /tmp/copy-tiny-file.out
|
|
||||||
- /tmp/copy-no-mode
|
|
||||||
- /tmp/copy-no-mode.out
|
|
||||||
- /tmp/copy-with-mode
|
|
||||||
- /tmp/copy-with-mode.out
|
|
||||||
- /tmp/copy-large-file
|
|
||||||
- /tmp/copy-large-file.out
|
|
||||||
- /tmp/copy-tiny-inline-file.out
|
|
||||||
- /tmp/copy-large-inline-file
|
|
||||||
- /tmp/copy-large-inline-file.out
|
|
||||||
|
|
||||||
# end of cleaning out files (again)
|
|
||||||
tags:
|
tags:
|
||||||
- copy
|
- copy
|
||||||
|
- issue_1110
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
- import_playbook: args.yml
|
||||||
- import_playbook: config.yml
|
- import_playbook: config.yml
|
||||||
|
- import_playbook: password.yml
|
||||||
- import_playbook: timeouts.yml
|
- import_playbook: timeouts.yml
|
||||||
- import_playbook: variables.yml
|
- import_playbook: variables.yml
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
- name: integration/ssh/args.yml
|
||||||
|
hosts: issue905
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
# Test that ansible_ssh_common_args are templated; ansible_ssh_args &
|
||||||
|
# ansible_ssh_extra_args aren't directly tested, we assume they're similar.
|
||||||
|
# FIXME This test currently relies on variables set in the host group.
|
||||||
|
# Ideally they'd be set here, and the host group eliminated, but
|
||||||
|
# Mitogen currently fails to template when defined in the play.
|
||||||
|
# TODO Replace LocalCommand canary with SetEnv canary, to simplify test.
|
||||||
|
# Requires modification of sshd_config files to add AcceptEnv ...
|
||||||
|
- name: Test templating of ansible_ssh_common_args et al
|
||||||
|
block:
|
||||||
|
- name: Ensure no lingering canary files
|
||||||
|
file:
|
||||||
|
path: "{{ ssh_args_canary_file }}"
|
||||||
|
state: absent
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
|
- name: Reset connections to force new ssh execution
|
||||||
|
meta: reset_connection
|
||||||
|
|
||||||
|
- name: Perform SSH connection, to trigger side effect
|
||||||
|
ping:
|
||||||
|
|
||||||
|
# LocalCommand="touch {{ ssh_args_canary_file }}" in ssh_*_args
|
||||||
|
- name: Stat for canary file created by side effect
|
||||||
|
stat:
|
||||||
|
path: "{{ ssh_args_canary_file }}"
|
||||||
|
delegate_to: localhost
|
||||||
|
register: ssh_args_canary_stat
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- ssh_args_canary_stat.stat.exists == true
|
||||||
|
quiet: true
|
||||||
|
success_msg: "Canary found: {{ ssh_args_canary_file }}"
|
||||||
|
fail_msg: |
|
||||||
|
ssh_args_canary_file={{ ssh_args_canary_file }}
|
||||||
|
ssh_args_canary_stat={{ ssh_args_canary_stat }}
|
||||||
|
always:
|
||||||
|
- name: Cleanup canary files
|
||||||
|
file:
|
||||||
|
path: "{{ ssh_args_canary_file }}"
|
||||||
|
state: absent
|
||||||
|
delegate_to: localhost
|
||||||
|
tags:
|
||||||
|
- issue_905
|
@ -0,0 +1,51 @@
|
|||||||
|
- name: integration/ssh/password.yml
|
||||||
|
hosts: test-targets[0]
|
||||||
|
gather_facts: false
|
||||||
|
vars:
|
||||||
|
ansible_user: mitogen__user1
|
||||||
|
tasks:
|
||||||
|
- meta: reset_connection
|
||||||
|
- name: ansible_password
|
||||||
|
vars:
|
||||||
|
ansible_password: user1_password
|
||||||
|
ping:
|
||||||
|
|
||||||
|
- meta: reset_connection
|
||||||
|
- name: ansible_ssh_pass
|
||||||
|
vars:
|
||||||
|
ansible_ssh_pass: user1_password
|
||||||
|
ping:
|
||||||
|
|
||||||
|
- meta: reset_connection
|
||||||
|
- name: absent password should fail
|
||||||
|
ping:
|
||||||
|
ignore_errors: true
|
||||||
|
ignore_unreachable: true
|
||||||
|
register: ssh_no_password_result
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- ssh_no_password_result.unreachable == True
|
||||||
|
fail_msg: ssh_no_password_result={{ ssh_no_password_result }}
|
||||||
|
|
||||||
|
- meta: reset_connection
|
||||||
|
- name: ansible_ssh_pass should override ansible_password
|
||||||
|
ping:
|
||||||
|
vars:
|
||||||
|
ansible_password: wrong
|
||||||
|
ansible_ssh_pass: user1_password
|
||||||
|
|
||||||
|
# Tests that ansible_ssh_pass has priority over ansible_password
|
||||||
|
# and that a wrong password causes a target to be marked unreachable.
|
||||||
|
- meta: reset_connection
|
||||||
|
- name: ansible_password should not override
|
||||||
|
vars:
|
||||||
|
ansible_password: user1_password
|
||||||
|
ansible_ssh_pass: wrong
|
||||||
|
ping:
|
||||||
|
ignore_errors: true
|
||||||
|
ignore_unreachable: true
|
||||||
|
register: ssh_wrong_password_result
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- ssh_wrong_password_result.unreachable == True
|
||||||
|
fail_msg: ssh_wrong_password_result={{ ssh_wrong_password_result }}
|
@ -0,0 +1,43 @@
|
|||||||
|
- name: regression/issue_1087__template_streamerror.yml
|
||||||
|
# Ansible's template module has been seen to raise mitogen.core.StreamError
|
||||||
|
# iif there is a with_items loop and the destination path has an extension.
|
||||||
|
# This printed an error message and left file permissions incorrect,
|
||||||
|
# but did not cause the task/playbook to fail.
|
||||||
|
hosts: test-targets
|
||||||
|
gather_facts: false
|
||||||
|
become: false
|
||||||
|
vars:
|
||||||
|
foos:
|
||||||
|
- dest: /tmp/foo
|
||||||
|
- dest: /tmp/foo.txt
|
||||||
|
foo: Foo
|
||||||
|
bar: Bar
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- name: Test template does not cause StreamError
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: true
|
||||||
|
environment:
|
||||||
|
ANSIBLE_VERBOSITY: "{{ ansible_verbosity }}"
|
||||||
|
command:
|
||||||
|
cmd: >
|
||||||
|
ansible-playbook
|
||||||
|
{% for inv in ansible_inventory_sources %}
|
||||||
|
-i "{{ inv }}"
|
||||||
|
{% endfor %}
|
||||||
|
regression/template_test.yml
|
||||||
|
chdir: ../
|
||||||
|
register: issue_1087_cmd
|
||||||
|
failed_when:
|
||||||
|
- issue_1087_cmd is failed
|
||||||
|
or issue_1087_cmd.stdout is search('ERROR|mitogen\.core\.CallError')
|
||||||
|
or issue_1087_cmd.stderr is search('ERROR|mitogen\.core\.CallError')
|
||||||
|
|
||||||
|
always:
|
||||||
|
- name: Cleanup
|
||||||
|
file:
|
||||||
|
path: "{{ item.dest }}"
|
||||||
|
state: absent
|
||||||
|
with_items: "{{ foos }}"
|
||||||
|
tags:
|
||||||
|
- issue_1087
|
@ -0,0 +1,28 @@
|
|||||||
|
- name: regression/template_test.yml
|
||||||
|
# Ansible's template module has been seen to raise mitogen.core.StreamError
|
||||||
|
# iif there is a with_items loop and the destination path has an extension
|
||||||
|
hosts: test-targets
|
||||||
|
gather_facts: false
|
||||||
|
become: false
|
||||||
|
vars:
|
||||||
|
foos:
|
||||||
|
- dest: /tmp/foo
|
||||||
|
- dest: /tmp/foo.txt
|
||||||
|
foo: Foo
|
||||||
|
bar: Bar
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- name: Template files
|
||||||
|
template:
|
||||||
|
src: foo.bar.j2
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: u=rw,go=r
|
||||||
|
# This has to be with_items, loop: doesn't trigger the bug
|
||||||
|
with_items: "{{ foos }}"
|
||||||
|
|
||||||
|
always:
|
||||||
|
- name: Cleanup
|
||||||
|
file:
|
||||||
|
path: "{{ item.dest }}"
|
||||||
|
state: absent
|
||||||
|
with_items: "{{ foos }}"
|
@ -0,0 +1 @@
|
|||||||
|
A {{ foo }} walks into a {{ bar }}. Ow!
|
@ -1,4 +1,7 @@
|
|||||||
paramiko==2.3.2 # Last 2.6-compat version.
|
paramiko==2.3.2 # Last 2.6-compat version.
|
||||||
|
# Incompatible with pip >= 72, due to removal of `setup.py test`:
|
||||||
|
# ModuleNotFoundError: No module named 'setuptools.command.test'
|
||||||
|
# https://github.com/pypa/setuptools/issues/4519
|
||||||
hdrhistogram==0.6.1
|
hdrhistogram==0.6.1
|
||||||
PyYAML==3.11; python_version < '2.7'
|
PyYAML==3.11; python_version < '2.7'
|
||||||
PyYAML==5.3.1; python_version >= '2.7' # Latest release (Jan 2021)
|
PyYAML==5.3.1; python_version >= '2.7' # Latest release (Jan 2021)
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
[test-targets]
|
||||||
|
{% for c in containers %}
|
||||||
|
{{ c.name }} ansible_host={{ c.hostname }} ansible_port={{ c.port }} ansible_python_interpreter={{ c.python_path }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
[test-targets:vars]
|
||||||
|
ansible_user=mitogen__has_sudo_nopw
|
||||||
|
ansible_password=has_sudo_nopw_password
|
||||||
|
|
||||||
|
{% for distro, hostnames in distros | dictsort %}
|
||||||
|
[{{ distro }}]
|
||||||
|
{% for hostname in hostnames %}
|
||||||
|
{{ hostname }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for family, hostnames in families | dictsort %}
|
||||||
|
[{{ family }}]
|
||||||
|
{% for hostname in hostnames %}
|
||||||
|
{{ hostname }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
[linux:children]
|
||||||
|
test-targets
|
||||||
|
|
||||||
|
[linux_containers:children]
|
||||||
|
test-targets
|
||||||
|
|
||||||
|
[issue905]
|
||||||
|
{% for c in containers[:1] %}
|
||||||
|
ssh-common-args ansible_host={{ c.hostname }} ansible_port={{ c.port }} ansible_python_interpreter={{ c.python_path }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
[issue905:vars]
|
||||||
|
ansible_user=mitogen__has_sudo_nopw
|
||||||
|
ansible_password=has_sudo_nopw_password
|
||||||
|
ansible_ssh_common_args=-o PermitLocalCommand=yes -o LocalCommand="touch {{ '{{' }} ssh_args_canary_file {{ '}}' }}"
|
||||||
|
ssh_args_canary_file=/tmp/ssh_args_{{ '{{' }} inventory_hostname {{ '}}' }}
|
@ -0,0 +1,3 @@
|
|||||||
|
# Setuptools 72 removed `setup.py test`. hdrhistogram 0.6.1 still depends on it.
|
||||||
|
# TODO Bump dependencies and unconstrain Pip.
|
||||||
|
setuptools<72
|
Loading…
Reference in New Issue