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:
AlanCoding
2019-09-18 08:43:36 -04:00
parent 75bb7aae14
commit 7dd8e35e8c
27 changed files with 88 additions and 29 deletions

View File

@@ -374,11 +374,9 @@ test:
fi; \ fi; \
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS) PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
cd awxkit && $(VENV_BASE)/awx/bin/tox -re py2,py3 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' awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
prepare_collection_venv: prepare_collection_venv:
cd /awx_devel
rm -rf $(COLLECTION_VENV) rm -rf $(COLLECTION_VENV)
mkdir $(COLLECTION_VENV) mkdir $(COLLECTION_VENV)
ln -s /usr/lib/python2.7/site-packages/ansible $(COLLECTION_VENV)/ansible ln -s /usr/lib/python2.7/site-packages/ansible $(COLLECTION_VENV)/ansible
@@ -397,8 +395,6 @@ test_collection:
flake8_collection: flake8_collection:
flake8 awx_collection/ # Different settings, in main exclude list 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 test_collection_all: prepare_collection_venv test_collection flake8_collection
build_collection: build_collection:

View File

@@ -1,11 +1,11 @@
# AWX Ansible Collection # 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. server in Ansible playbooks.
The previous home for this collection was in https://github.com/ansible/ansible The previous home for this collection was in https://github.com/ansible/ansible
inside the folder `lib/ansible/modules/web_infrastructure/ansible_tower` 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. doc fragment.
## Running ## Running

View 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
'''

View File

@@ -145,7 +145,7 @@ options:
choices: ["present", "absent"] choices: ["present", "absent"]
default: "present" default: "present"
type: str type: str
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -64,7 +64,7 @@ options:
required: False required: False
type: bool type: bool
aliases: [ tower_verify_ssl ] aliases: [ tower_verify_ssl ]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -77,7 +77,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -47,7 +47,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
choices: ["present", "absent"] choices: ["present", "absent"]
default: "present" default: "present"
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -52,7 +52,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -143,7 +143,7 @@ options:
- Tower option to avoid certificates check. - Tower option to avoid certificates check.
type: bool type: bool
aliases: [ tower_verify_ssl ] aliases: [ tower_verify_ssl ]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -32,7 +32,7 @@ options:
- Fail loudly if the I(job_id) does not reference a running job. - Fail loudly if the I(job_id) does not reference a running job.
default: False default: False
type: bool type: bool
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''
EXAMPLES = ''' EXAMPLES = '''

View File

@@ -54,7 +54,7 @@ options:
- Disable launching jobs from job template. - Disable launching jobs from job template.
type: bool type: bool
default: 'no' default: 'no'
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''
EXAMPLES = ''' EXAMPLES = '''

View File

@@ -38,7 +38,7 @@ options:
query: query:
description: description:
- Query used to further filter the list of jobs. C({"foo":"bar"}) will be passed at C(?foo=bar) - 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
''' '''

View File

@@ -176,7 +176,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
notes: notes:
- JSON for survey_spec can be found in Tower API Documentation. See - 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) U(https://docs.ansible.com/ansible-tower/latest/html/towerapi/api_ref.html#/Job_Templates/Job_Templates_job_templates_survey_spec_create)

View File

@@ -38,7 +38,7 @@ options:
timeout: timeout:
description: description:
- Maximum time in seconds to wait for a job to finish. - Maximum time in seconds to wait for a job to finish.
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''
EXAMPLES = ''' EXAMPLES = '''

View File

@@ -36,7 +36,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -164,7 +164,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -35,7 +35,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -85,7 +85,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -79,7 +79,7 @@ requirements:
notes: notes:
- Specifying a name of "all" for any asset type will export all items of that asset type. - 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 = ''' EXAMPLES = '''

View File

@@ -58,7 +58,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -54,7 +54,7 @@ requirements:
- six.moves.StringIO - six.moves.StringIO
- sys - sys
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''
EXAMPLES = ''' EXAMPLES = '''

View File

@@ -31,7 +31,7 @@ options:
description: description:
- Value to be modified for given setting. - Value to be modified for given setting.
required: True required: True
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''
RETURN = ''' # ''' RETURN = ''' # '''

View File

@@ -36,7 +36,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
choices: ["present", "absent"] choices: ["present", "absent"]
default: "present" default: "present"
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -59,7 +59,7 @@ options:
requirements: requirements:
- ansible-tower-cli >= 3.2.0 - ansible-tower-cli >= 3.2.0
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -41,7 +41,7 @@ options:
requirements: requirements:
- "python >= 2.6" - "python >= 2.6"
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''
RETURN = ''' RETURN = '''

View File

@@ -73,7 +73,7 @@ options:
- Desired state of the resource. - Desired state of the resource.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
extends_documentation_fragment: tower extends_documentation_fragment: awx.awx.auth
''' '''

View File

@@ -7,5 +7,22 @@
package_version: 0.0.1 package_version: 0.0.1
tasks: 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 - name: Template the galaxy.yml file
template: src={{ playbook_dir }}/galaxy.yml.j2 dest={{ playbook_dir }}/galaxy.yml template: src={{ playbook_dir }}/galaxy.yml.j2 dest={{ playbook_dir }}/galaxy.yml