mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
update to tower_project_update
This commit is contained in:
@@ -52,10 +52,16 @@ extends_documentation_fragment: awx.awx.auth
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
project_info:
|
id:
|
||||||
description: dictionary containing information about the project updated
|
description: project id of the updated project
|
||||||
returned: If project synced
|
returned: success
|
||||||
type: dict
|
type: int
|
||||||
|
sample: 86
|
||||||
|
status:
|
||||||
|
description: status of the updated project
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
|
sample: pending
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@@ -81,9 +87,9 @@ def main():
|
|||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True, aliases=['project']),
|
name=dict(required=True, aliases=['project']),
|
||||||
organization=dict(),
|
organization=dict(),
|
||||||
wait=dict(required=False, default=True, type='bool'),
|
wait=dict(default=True, type='bool'),
|
||||||
interval=dict(required=False, default=1.0, type='float'),
|
interval=dict(default=1.0, type='float'),
|
||||||
timeout=dict(required=False, default=None, type='int'),
|
timeout=dict(default=None, type='int'),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create a module for ourselves
|
# Create a module for ourselves
|
||||||
|
|||||||
@@ -1,9 +1,31 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate a random string for test
|
||||||
|
set_fact:
|
||||||
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
project_name1: "AWX-Collection-tests-tower_project_update-project-{{ test_id }}"
|
||||||
|
|
||||||
|
- name: Create a git project without credentials without waiting
|
||||||
|
tower_project:
|
||||||
|
name: "{{ project_name1 }}"
|
||||||
|
organization: Default
|
||||||
|
scm_type: git
|
||||||
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
|
wait: false
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
|
|
||||||
- name: Update a project without waiting
|
- name: Update a project without waiting
|
||||||
tower_project_update:
|
tower_project_update:
|
||||||
name: "AWX-Collection-tests-tower_job_template-proj-{{ test_id }}"
|
name: "{{ project_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
wait: False
|
wait: false
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
@@ -12,11 +34,22 @@
|
|||||||
|
|
||||||
- name: Update a project and wait
|
- name: Update a project and wait
|
||||||
tower_project_update:
|
tower_project_update:
|
||||||
name: "AWX-Collection-tests-tower_job_template-proj-{{ test_id }}"
|
name: "{{ project_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
wait: True
|
wait: true
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
|
- name: Delete the test project 1
|
||||||
|
tower_project:
|
||||||
|
name: "{{ project_name1 }}"
|
||||||
|
organization: Default
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
Reference in New Issue
Block a user