mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Use namespaced doc fragment, cleanup
doc fragment will now be at awx.awx.auth changed from just tower, which source from core remove Makefile things no longer needed
This commit is contained in:
parent
75bb7aae14
commit
7dd8e35e8c
4
Makefile
4
Makefile
@ -374,11 +374,9 @@ test:
|
||||
fi; \
|
||||
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
|
||||
cd awxkit && $(VENV_BASE)/awx/bin/tox -re py2,py3
|
||||
make test_collection_all
|
||||
awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
|
||||
|
||||
prepare_collection_venv:
|
||||
cd /awx_devel
|
||||
rm -rf $(COLLECTION_VENV)
|
||||
mkdir $(COLLECTION_VENV)
|
||||
ln -s /usr/lib/python2.7/site-packages/ansible $(COLLECTION_VENV)/ansible
|
||||
@ -397,8 +395,6 @@ test_collection:
|
||||
flake8_collection:
|
||||
flake8 awx_collection/ # Different settings, in main exclude list
|
||||
|
||||
prepare_test_collection: prepare_collection_venv test_collection # deprecated
|
||||
|
||||
test_collection_all: prepare_collection_venv test_collection flake8_collection
|
||||
|
||||
build_collection:
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
# AWX Ansible Collection
|
||||
|
||||
This Ansible collection allow for easy interaction with an AWX or Ansible Tower
|
||||
This Ansible collection allows for easy interaction with an AWX or Ansible Tower
|
||||
server in Ansible playbooks.
|
||||
|
||||
The previous home for this collection was in https://github.com/ansible/ansible
|
||||
inside the folder `lib/ansible/modules/web_infrastructure/ansible_tower`
|
||||
as well as other places for the inventory plugin, module utils, and
|
||||
as well as other folders for the inventory plugin, module utils, and
|
||||
doc fragment.
|
||||
|
||||
## Running
|
||||
|
||||
46
awx_collection/plugins/doc_fragments/auth.py
Normal file
46
awx_collection/plugins/doc_fragments/auth.py
Normal file
@ -0,0 +1,46 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
|
||||
class ModuleDocFragment(object):
|
||||
|
||||
# Ansible Tower documentation fragment
|
||||
DOCUMENTATION = r'''
|
||||
options:
|
||||
tower_host:
|
||||
description:
|
||||
- URL to your Tower or AWX instance.
|
||||
type: str
|
||||
tower_username:
|
||||
description:
|
||||
- Username for your Tower or AWX instance.
|
||||
type: str
|
||||
tower_password:
|
||||
description:
|
||||
- Password for your Tower or AWX instance.
|
||||
type: str
|
||||
validate_certs:
|
||||
description:
|
||||
- Whether to allow insecure connections to Tower or AWX.
|
||||
- If C(no), SSL certificates will not be validated.
|
||||
- This should only be used on personally controlled sites using self-signed certificates.
|
||||
type: bool
|
||||
aliases: [ tower_verify_ssl ]
|
||||
tower_config_file:
|
||||
description:
|
||||
- Path to the Tower or AWX config file.
|
||||
type: path
|
||||
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.0.2
|
||||
|
||||
notes:
|
||||
- If no I(config_file) is provided we will attempt to use the tower-cli library
|
||||
defaults to find your Tower host information.
|
||||
- I(config_file) should contain Tower configuration in the following format
|
||||
host=hostname
|
||||
username=username
|
||||
password=password
|
||||
'''
|
||||
@ -145,7 +145,7 @@ options:
|
||||
choices: ["present", "absent"]
|
||||
default: "present"
|
||||
type: str
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ options:
|
||||
required: False
|
||||
type: bool
|
||||
aliases: [ tower_verify_ssl ]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
choices: ["present", "absent"]
|
||||
default: "present"
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ options:
|
||||
- Tower option to avoid certificates check.
|
||||
type: bool
|
||||
aliases: [ tower_verify_ssl ]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ options:
|
||||
- Fail loudly if the I(job_id) does not reference a running job.
|
||||
default: False
|
||||
type: bool
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
||||
@ -54,7 +54,7 @@ options:
|
||||
- Disable launching jobs from job template.
|
||||
type: bool
|
||||
default: 'no'
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
||||
@ -38,7 +38,7 @@ options:
|
||||
query:
|
||||
description:
|
||||
- Query used to further filter the list of jobs. C({"foo":"bar"}) will be passed at C(?foo=bar)
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
notes:
|
||||
- JSON for survey_spec can be found in Tower API Documentation. See
|
||||
U(https://docs.ansible.com/ansible-tower/latest/html/towerapi/api_ref.html#/Job_Templates/Job_Templates_job_templates_survey_spec_create)
|
||||
|
||||
@ -38,7 +38,7 @@ options:
|
||||
timeout:
|
||||
description:
|
||||
- Maximum time in seconds to wait for a job to finish.
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
||||
@ -36,7 +36,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ requirements:
|
||||
notes:
|
||||
- Specifying a name of "all" for any asset type will export all items of that asset type.
|
||||
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
||||
@ -58,7 +58,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ requirements:
|
||||
- six.moves.StringIO
|
||||
- sys
|
||||
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
||||
@ -31,7 +31,7 @@ options:
|
||||
description:
|
||||
- Value to be modified for given setting.
|
||||
required: True
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
RETURN = ''' # '''
|
||||
|
||||
@ -36,7 +36,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
choices: ["present", "absent"]
|
||||
default: "present"
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ options:
|
||||
requirements:
|
||||
- ansible-tower-cli >= 3.2.0
|
||||
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ options:
|
||||
|
||||
requirements:
|
||||
- "python >= 2.6"
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
||||
@ -73,7 +73,7 @@ options:
|
||||
- Desired state of the resource.
|
||||
default: "present"
|
||||
choices: ["present", "absent"]
|
||||
extends_documentation_fragment: tower
|
||||
extends_documentation_fragment: awx.awx.auth
|
||||
'''
|
||||
|
||||
|
||||
|
||||
@ -7,5 +7,22 @@
|
||||
package_version: 0.0.1
|
||||
|
||||
tasks:
|
||||
- name: Do file content replacements for non-default namespace or package name
|
||||
block:
|
||||
- name: Find all module files
|
||||
find:
|
||||
paths: "{{ playbook_dir }}/plugins/modules"
|
||||
patterns: "*.py"
|
||||
register: module_files
|
||||
|
||||
- name: Change files to support desired namespace and package names
|
||||
replace:
|
||||
path: "{{ item.path }}"
|
||||
regexp: '^extends_documentation_fragment: awx.awx.auth$'
|
||||
replace: 'extends_documentation_fragment: {{ namespace_name }}.{{ package_name }}.auth'
|
||||
with_items: "{{ module_files.files }}"
|
||||
when:
|
||||
- (package_name != 'awx') or (namespace_name != 'awx')
|
||||
|
||||
- name: Template the galaxy.yml file
|
||||
template: src={{ playbook_dir }}/galaxy.yml.j2 dest={{ playbook_dir }}/galaxy.yml
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user