mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Fix differences with devel.
This commit is contained in:
parent
1c9a58a885
commit
c709b22e5c
32 changed files with 78 additions and 237 deletions
|
@ -5,14 +5,15 @@ set -e
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
# get current stuff
|
# get current stuff
|
||||||
git clone git@github.com:ansible/ansible.git ansible_unified
|
git clone https://github.com/ansible/ansible.git ansible_unified
|
||||||
cd ansible_unified/
|
cd ansible_unified/
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update
|
||||||
|
git remote add upstream git@github.com:ansible/ansible.git
|
||||||
|
|
||||||
# add submodules as remotes
|
# add submodules as remotes
|
||||||
git remote add core_modules git@github.com:ansible/ansible-modules-core.git
|
git remote add core_modules https://github.com/ansible/ansible-modules-core.git
|
||||||
git remote add extras_modules git@github.com:ansible/ansible-modules-extras.git
|
git remote add extras_modules https://github.com/ansible/ansible-modules-extras.git
|
||||||
git fetch --all
|
git fetch --all
|
||||||
|
|
||||||
# remove submodules
|
# remove submodules
|
||||||
|
@ -52,5 +53,5 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
git rm -rf lib/ansible/modules/${subdir}
|
rm -rf lib/ansible/modules/${subdir}
|
||||||
done
|
done
|
||||||
|
|
0
lib/ansible/modules/cloud/amazon/ec2.py
Executable file → Normal file
0
lib/ansible/modules/cloud/amazon/ec2.py
Executable file → Normal file
0
lib/ansible/modules/cloud/amazon/rds.py
Executable file → Normal file
0
lib/ansible/modules/cloud/amazon/rds.py
Executable file → Normal file
|
@ -24,7 +24,7 @@ DOCUMENTATION = '''
|
||||||
module: digital_ocean
|
module: digital_ocean
|
||||||
short_description: Create/delete a droplet/SSH_key in DigitalOcean
|
short_description: Create/delete a droplet/SSH_key in DigitalOcean
|
||||||
description:
|
description:
|
||||||
- Create/delete a droplet in DigitalOcean and optionally wait for it to be 'running', or deploy an SSH key.
|
- Create/delete a droplet in DigitalOcean and optionally wait for it to be 'running', or deploy an SSH key.
|
||||||
version_added: "1.3"
|
version_added: "1.3"
|
||||||
author: "Vincent Viallet (@zbal)"
|
author: "Vincent Viallet (@zbal)"
|
||||||
options:
|
options:
|
||||||
|
|
|
@ -22,8 +22,9 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from quantumclient.quantum import client
|
from quantumclient.quantum import client
|
||||||
from keystoneclient.v2_0 import client as ksclient
|
from keystoneclient.v2_0 import client as ksclient
|
||||||
|
HAVE_DEPS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("failed=True msg='quantumclient (or neutronclient) and keystoneclient are required'")
|
HAVE_DEPS = False
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'status': ['deprecated'],
|
ANSIBLE_METADATA = {'status': ['deprecated'],
|
||||||
'supported_by': 'community',
|
'supported_by': 'community',
|
||||||
|
@ -119,7 +120,10 @@ options:
|
||||||
- From the subnet pool the last IP that should be assigned to the virtual machines
|
- From the subnet pool the last IP that should be assigned to the virtual machines
|
||||||
required: false
|
required: false
|
||||||
default: None
|
default: None
|
||||||
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
|
requirements:
|
||||||
|
- "python >= 2.6"
|
||||||
|
- "python-neutronclient or python-quantumclient"
|
||||||
|
- "python-keystoneclient"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
@ -278,6 +282,9 @@ def main():
|
||||||
allocation_pool_end = dict(default=None),
|
allocation_pool_end = dict(default=None),
|
||||||
))
|
))
|
||||||
module = AnsibleModule(argument_spec=argument_spec)
|
module = AnsibleModule(argument_spec=argument_spec)
|
||||||
|
if not HAVE_DEPS:
|
||||||
|
module.fail_json(msg='python-keystoneclient and either python-neutronclient or python-quantumclient are required')
|
||||||
|
|
||||||
neutron = _get_neutron_client(module, module.params)
|
neutron = _get_neutron_client(module, module.params)
|
||||||
_set_tenant_id(module)
|
_set_tenant_id(module)
|
||||||
if module.params['state'] == 'present':
|
if module.params['state'] == 'present':
|
||||||
|
@ -298,5 +305,6 @@ def main():
|
||||||
# this is magic, see lib/ansible/module.params['common.py
|
# this is magic, see lib/ansible/module.params['common.py
|
||||||
from ansible.module_utils.basic import *
|
from ansible.module_utils.basic import *
|
||||||
from ansible.module_utils.openstack import *
|
from ansible.module_utils.openstack import *
|
||||||
main()
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ short_description: Retrieve an auth token
|
||||||
version_added: "2.0"
|
version_added: "2.0"
|
||||||
author: "Monty Taylor (@emonty)"
|
author: "Monty Taylor (@emonty)"
|
||||||
description:
|
description:
|
||||||
- Retrieve an auth token from an OpenStack Cloud
|
- Retrieve an auth token from an OpenStack Cloud
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 2.6"
|
- "python >= 2.6"
|
||||||
- "shade"
|
- "shade"
|
||||||
|
|
|
@ -519,24 +519,24 @@ class PyVmomiHelper(object):
|
||||||
|
|
||||||
|
|
||||||
def set_powerstate(self, vm, state, force):
|
def set_powerstate(self, vm, state, force):
|
||||||
"""
|
"""
|
||||||
Set the power status for a VM determined by the current and
|
Set the power status for a VM determined by the current and
|
||||||
requested states. force is forceful
|
requested states. force is forceful
|
||||||
"""
|
"""
|
||||||
facts = self.gather_facts(vm)
|
facts = self.gather_facts(vm)
|
||||||
expected_state = state.replace('_', '').lower()
|
expected_state = state.replace('_', '').lower()
|
||||||
current_state = facts['hw_power_status'].lower()
|
current_state = facts['hw_power_status'].lower()
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
# Need Force
|
# Need Force
|
||||||
if not force and current_state not in ['poweredon', 'poweredoff']:
|
if not force and current_state not in ['poweredon', 'poweredoff']:
|
||||||
return "VM is in %s power state. Force is required!" % current_state
|
return "VM is in %s power state. Force is required!" % current_state
|
||||||
|
|
||||||
# State is already true
|
# State is already true
|
||||||
if current_state == expected_state:
|
if current_state == expected_state:
|
||||||
result['changed'] = False
|
result['changed'] = False
|
||||||
result['failed'] = False
|
result['failed'] = False
|
||||||
else:
|
else:
|
||||||
task = None
|
task = None
|
||||||
try:
|
try:
|
||||||
if expected_state == 'poweredoff':
|
if expected_state == 'poweredoff':
|
||||||
|
@ -602,20 +602,20 @@ class PyVmomiHelper(object):
|
||||||
else:
|
else:
|
||||||
facts['ipv4'] = ipaddress
|
facts['ipv4'] = ipaddress
|
||||||
|
|
||||||
for idx,entry in enumerate(vm.config.hardware.device):
|
for idx,entry in enumerate(vm.config.hardware.device):
|
||||||
if not hasattr(entry, 'macAddress'):
|
if not hasattr(entry, 'macAddress'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
factname = 'hw_eth' + str(idx)
|
factname = 'hw_eth' + str(idx)
|
||||||
facts[factname] = {
|
facts[factname] = {
|
||||||
'addresstype': entry.addressType,
|
'addresstype': entry.addressType,
|
||||||
'label': entry.deviceInfo.label,
|
'label': entry.deviceInfo.label,
|
||||||
'macaddress': entry.macAddress,
|
'macaddress': entry.macAddress,
|
||||||
'ipaddresses': netDict.get(entry.macAddress, None),
|
'ipaddresses': netDict.get(entry.macAddress, None),
|
||||||
'macaddress_dash': entry.macAddress.replace(':', '-'),
|
'macaddress_dash': entry.macAddress.replace(':', '-'),
|
||||||
'summary': entry.deviceInfo.summary,
|
'summary': entry.deviceInfo.summary,
|
||||||
}
|
}
|
||||||
facts['hw_interfaces'].append('eth'+str(idx))
|
facts['hw_interfaces'].append('eth'+str(idx))
|
||||||
|
|
||||||
return facts
|
return facts
|
||||||
|
|
||||||
|
|
0
lib/ansible/modules/system/group.py
Executable file → Normal file
0
lib/ansible/modules/system/group.py
Executable file → Normal file
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash -eux
|
|
||||||
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
source_root=$(python -c "from os import path; print(path.abspath(path.join(path.dirname('$0'), '../../..')))")
|
|
||||||
|
|
||||||
"${source_root}/test/utils/shippable/${TEST}.sh" 2>&1 | gawk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
|
|
|
@ -1,2 +0,0 @@
|
||||||
jinja2
|
|
||||||
pyyaml
|
|
|
@ -1,62 +0,0 @@
|
||||||
#!/bin/bash -eux
|
|
||||||
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
ansible_repo_url="https://github.com/ansible/ansible.git"
|
|
||||||
|
|
||||||
build_dir="${SHIPPABLE_BUILD_DIR}"
|
|
||||||
repo="${REPO_NAME}"
|
|
||||||
|
|
||||||
case "${repo}" in
|
|
||||||
"ansible-modules-core")
|
|
||||||
this_module_group="core"
|
|
||||||
other_module_group="extras"
|
|
||||||
;;
|
|
||||||
"ansible-modules-extras")
|
|
||||||
this_module_group="extras"
|
|
||||||
other_module_group="core"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported repo name: ${repo}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
modules_tmp_dir="${build_dir}.tmp"
|
|
||||||
this_modules_dir="${build_dir}/lib/ansible/modules/${this_module_group}"
|
|
||||||
other_modules_dir="${build_dir}/lib/ansible/modules/${other_module_group}"
|
|
||||||
|
|
||||||
cd /
|
|
||||||
mv "${build_dir}" "${modules_tmp_dir}"
|
|
||||||
git clone "${ansible_repo_url}" "${build_dir}"
|
|
||||||
cd "${build_dir}"
|
|
||||||
rmdir "${this_modules_dir}"
|
|
||||||
mv "${modules_tmp_dir}" "${this_modules_dir}"
|
|
||||||
mv "${this_modules_dir}/shippable" "${build_dir}"
|
|
||||||
git submodule init "${other_modules_dir}"
|
|
||||||
git submodule sync "${other_modules_dir}"
|
|
||||||
git submodule update "${other_modules_dir}"
|
|
||||||
|
|
||||||
pip install -r lib/ansible/modules/${this_module_group}/test/utils/shippable/docs-requirements.txt --upgrade
|
|
||||||
pip list
|
|
||||||
|
|
||||||
source hacking/env-setup
|
|
||||||
|
|
||||||
docs_status=0
|
|
||||||
|
|
||||||
PAGER=/bin/cat \
|
|
||||||
ANSIBLE_DEPRECATION_WARNINGS=false \
|
|
||||||
bin/ansible-doc -l \
|
|
||||||
2>/tmp/ansible-doc.err || docs_status=$?
|
|
||||||
|
|
||||||
if [ -s /tmp/ansible-doc.err ]; then
|
|
||||||
# report warnings as errors
|
|
||||||
echo "Output from 'ansible-doc -l' on stderr is considered an error:"
|
|
||||||
cat /tmp/ansible-doc.err
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${docs_status}" -ne 0 ]; then
|
|
||||||
echo "Running 'ansible-doc -l' failed with no output on stderr and exit code: ${docs_status}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
|
@ -1,55 +0,0 @@
|
||||||
#!/bin/bash -eux
|
|
||||||
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
ansible_repo_url="https://github.com/ansible/ansible.git"
|
|
||||||
|
|
||||||
is_pr="${IS_PULL_REQUEST}"
|
|
||||||
build_dir="${SHIPPABLE_BUILD_DIR}"
|
|
||||||
repo="${REPO_NAME}"
|
|
||||||
|
|
||||||
if [ "${is_pr}" != "true" ]; then
|
|
||||||
echo "Module integration tests are only supported on pull requests."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${repo}" in
|
|
||||||
"ansible-modules-core")
|
|
||||||
this_module_group="core"
|
|
||||||
other_module_group="extras"
|
|
||||||
;;
|
|
||||||
"ansible-modules-extras")
|
|
||||||
this_module_group="extras"
|
|
||||||
other_module_group="core"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported repo name: ${repo}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
modules_tmp_dir="${build_dir}.tmp"
|
|
||||||
this_modules_dir="${build_dir}/lib/ansible/modules/${this_module_group}"
|
|
||||||
other_modules_dir="${build_dir}/lib/ansible/modules/${other_module_group}"
|
|
||||||
|
|
||||||
cd /
|
|
||||||
mv "${build_dir}" "${modules_tmp_dir}"
|
|
||||||
git clone "${ansible_repo_url}" "${build_dir}"
|
|
||||||
cd "${build_dir}"
|
|
||||||
rmdir "${this_modules_dir}"
|
|
||||||
mv "${modules_tmp_dir}" "${this_modules_dir}"
|
|
||||||
mv "${this_modules_dir}/shippable" "${build_dir}"
|
|
||||||
git submodule init "${other_modules_dir}"
|
|
||||||
git submodule sync "${other_modules_dir}"
|
|
||||||
git submodule update "${other_modules_dir}"
|
|
||||||
|
|
||||||
pip install -r test/utils/shippable/modules/generate-tests-requirements.txt --upgrade
|
|
||||||
pip list
|
|
||||||
|
|
||||||
source hacking/env-setup
|
|
||||||
|
|
||||||
test/utils/shippable/modules/generate-tests "${this_module_group}" --verbose --output /tmp/integration.sh >/dev/null
|
|
||||||
|
|
||||||
if [ -f /tmp/integration.sh ]; then
|
|
||||||
/bin/bash -eux /tmp/integration.sh
|
|
||||||
fi
|
|
|
@ -1 +0,0 @@
|
||||||
/cloud/[^/]+/(?!(ec2_facts.py|_ec2_ami_search.py))
|
|
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/bash -eux
|
|
||||||
|
|
||||||
source_root=$(python -c "from os import path; print(path.abspath(path.join(path.dirname('$0'), '../../..')))")
|
|
||||||
|
|
||||||
install_deps="${INSTALL_DEPS:-}"
|
|
||||||
|
|
||||||
cd "${source_root}"
|
|
||||||
|
|
||||||
# FIXME REPOMERGE: No need to checkout ansible
|
|
||||||
build_dir=$(mktemp -d)
|
|
||||||
trap 'rm -rf "${build_dir}"' EXIT
|
|
||||||
|
|
||||||
git clone "https://github.com/ansible/ansible.git" "${build_dir}" --recursive
|
|
||||||
source "${build_dir}/hacking/env-setup"
|
|
||||||
# REPOMERGE: END
|
|
||||||
|
|
||||||
if [ "${install_deps}" != "" ]; then
|
|
||||||
add-apt-repository ppa:fkrull/deadsnakes
|
|
||||||
apt-add-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports universe'
|
|
||||||
apt-get update -qq
|
|
||||||
|
|
||||||
apt-get install -qq shellcheck python2.4
|
|
||||||
|
|
||||||
# Install dependencies for ansible and validate_modules
|
|
||||||
pip install -r "${build_dir}/test/utils/shippable/sanity-requirements.txt" --upgrade
|
|
||||||
pip list
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
validate_modules="${build_dir}/test/sanity/validate-modules/validate-modules"
|
|
||||||
|
|
||||||
python2.4 -m compileall -fq -x "($(printf %s "$(< "test/utils/shippable/sanity-skip-python24.txt"))" | tr '\n' '|')" .
|
|
||||||
python2.6 -m compileall -fq .
|
|
||||||
python2.7 -m compileall -fq .
|
|
||||||
python3.5 -m compileall -fq .
|
|
||||||
|
|
||||||
ANSIBLE_DEPRECATION_WARNINGS=false \
|
|
||||||
"${validate_modules}" --exclude '/utilities/|/shippable(/|$)' .
|
|
||||||
|
|
||||||
shellcheck \
|
|
||||||
test/utils/shippable/*.sh
|
|
|
@ -28,7 +28,7 @@ Function UserSearch
|
||||||
$searchDomain = $false
|
$searchDomain = $false
|
||||||
$searchDomainUPN = $false
|
$searchDomainUPN = $false
|
||||||
if ($accountName.Split("\").count -gt 1)
|
if ($accountName.Split("\").count -gt 1)
|
||||||
{
|
{
|
||||||
if ($accountName.Split("\")[0] -ne $env:COMPUTERNAME)
|
if ($accountName.Split("\")[0] -ne $env:COMPUTERNAME)
|
||||||
{
|
{
|
||||||
$searchDomain = $true
|
$searchDomain = $true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue