mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
mostly includes renaming non-syntax references to tower
This commit is contained in:
@@ -11,10 +11,10 @@ short_description: Search the API for objects
|
||||
requirements:
|
||||
- None
|
||||
description:
|
||||
- Returns GET requests from the Automation Controller API. See
|
||||
- Returns GET requests from the Automation Platform Controller API. See
|
||||
U(https://docs.ansible.com/ansible-tower/latest/html/towerapi/index.html) for API usage.
|
||||
- For use that is cross-compatible between the awx.awx and ansible.tower collection
|
||||
see the tower_meta module
|
||||
- For use that is cross-compatible between the awx.awx and ansible.controller collection
|
||||
see the controller_meta module
|
||||
extends_documentation_fragment: awx.awx.auth_plugin
|
||||
options:
|
||||
_terms:
|
||||
@@ -71,11 +71,11 @@ notes:
|
||||
EXAMPLES = """
|
||||
- name: Load the UI settings
|
||||
set_fact:
|
||||
tower_settings: "{{ lookup('awx.awx.controller_api', 'settings/ui') }}"
|
||||
controller_settings: "{{ lookup('awx.awx.controller_api', 'settings/ui') }}"
|
||||
|
||||
- name: Load the UI settings specifying the connection info
|
||||
set_fact:
|
||||
tower_settings: "{{ lookup('awx.awx.controller_api', 'settings/ui' host='tower.example.com', username='admin', password=my_pass_var, verify_ssl=False) }}"
|
||||
controller_settings: "{{ lookup('awx.awx.controller_api', 'settings/ui' host='tower.example.com', username='admin', password=my_pass_var, verify_ssl=False) }}"
|
||||
|
||||
- name: Report the usernames of all users with admin privs
|
||||
debug:
|
||||
@@ -89,14 +89,14 @@ EXAMPLES = """
|
||||
label: "{{ item['name'] }}"
|
||||
|
||||
- name: Make sure user 'john' is an org admin of the default org if the user exists
|
||||
tower_role:
|
||||
role:
|
||||
organization: Default
|
||||
role: admin
|
||||
user: john
|
||||
when: "lookup('awx.awx.controller_api', 'users', query_params={ 'username': 'john' }) | length == 1"
|
||||
|
||||
- name: Create an inventory group with all 'foo' hosts
|
||||
tower_group:
|
||||
group:
|
||||
name: "Foo Group"
|
||||
inventory: "Demo Inventory"
|
||||
hosts: >-
|
||||
|
||||
@@ -5,9 +5,9 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = """
|
||||
lookup: tower_schedule_rrule
|
||||
lookup: schedule_rrule
|
||||
author: John Westcott IV (@john-westcott-iv)
|
||||
short_description: Generate an rrule string which can be used for Tower Schedules
|
||||
short_description: Generate an rrule string which can be used for Schedules
|
||||
requirements:
|
||||
- pytz
|
||||
- python.dateutil >= 2.7.0
|
||||
@@ -75,7 +75,7 @@ DOCUMENTATION = """
|
||||
EXAMPLES = """
|
||||
- name: Create a string for a schedule
|
||||
debug:
|
||||
msg: "{{ query('awx.awx.tower_schedule_rrule', 'none', start_date='1979-09-13 03:45:07') }}"
|
||||
msg: "{{ query('awx.awx.schedule_rrule', 'none', start_date='1979-09-13 03:45:07') }}"
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
@@ -233,7 +233,7 @@ class LookupModule(LookupBase):
|
||||
|
||||
my_rule = rrule.rrule(**rrule_kwargs)
|
||||
|
||||
# All frequencies can use a timezone but rrule can't support the format that Tower uses.
|
||||
# All frequencies can use a timezone but rrule can't support the format that AWX uses.
|
||||
# So we will do a string manip here if we need to
|
||||
timezone = 'America/New_York'
|
||||
if 'timezone' in kwargs:
|
||||
@@ -243,7 +243,7 @@ class LookupModule(LookupBase):
|
||||
|
||||
# rrule puts a \n in the rule instad of a space and can't handle timezones
|
||||
return_rrule = str(my_rule).replace('\n', ' ').replace('DTSTART:', 'DTSTART;TZID={0}:'.format(timezone))
|
||||
# Tower requires an interval. rrule will not add interval if it's set to 1
|
||||
# AWX requires an interval. rrule will not add interval if it's set to 1
|
||||
if kwargs.get('every', 1) == 1:
|
||||
return_rrule = "{0};INTERVAL=1".format(return_rrule)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user