New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'tower_schedule' module for managing Ansible Tower Schedules #43437

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
5 participants
@dmsimard
Contributor

dmsimard commented Jul 30, 2018

SUMMARY

This adds a tower_schedule module that provides the ability to add
schedules for updating projects and inventory sources as well as running
job templates.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

tower_schedule

ANSIBLE VERSION

devel

Add a 'tower_schedule' module for managing Ansible Tower Schedules
This adds a tower_schedule module that provides the ability to add
schedules for updating projects and inventory sources as well as running
job templates.
@dmsimard

This comment has been minimized.

Contributor

dmsimard commented Jul 30, 2018

This is WIP but is in a state ready to get more eyeballs on.

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jul 30, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:155:8: undefined-variable Undefined variable 'module'

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "test/sanity/code-smell/docs-build.py", line 101, in <module>
    main()
  File "test/sanity/code-smell/docs-build.py", line 17, in main
    raise subprocess.CalledProcessError(sphinx.returncode, cmd, output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['make', 'singlehtmldocs']' returned non-zero exit status 2.

The test ansible-test sanity --test pep8 [explain] failed with 5 errors:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:113:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:129:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:135:17: E126 continuation line over-indented for hanging indent
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:146:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:160:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [explain] failed with 10 errors:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E312 No RETURN provided
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E324 Value for "default" from the argument_spec ('2018-07-30T17:01:18Z') for "start" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E324 Value for "default" from the argument_spec ('present') for "state" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E324 Value for "default" from the argument_spec ('runonce') for "frequency_unit" does not match the documentation (None)
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E324 Value for "default" from the argument_spec (True) for "tower_verify_ssl" does not match the documentation (False)
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E325 argument_spec for "tower_verify_ssl" defines type="bool" but documentation does not
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E326 Value for "choices" from the argument_spec (['present', 'absent', 'disabled']) for "state" does not match the documentation ([])
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:0:0: E326 Value for "choices" from the argument_spec (['runonce', 'minute', 'hour', 'day']) for "frequency_unit" does not match the documentation ([])
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:52:9: E302 DOCUMENTATION is not valid YAML
lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:245:0: E107 Imports should be directly below DOCUMENTATION/EXAMPLES/RETURN/ANSIBLE_METADATA.

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_schedule.py:52:9: error DOCUMENTATION: syntax error: expected <block end>, but found '<block mapping start>'

click here for bot help

@ansibot

This comment has been minimized.

@AlanCoding

This comment has been minimized.

Member

AlanCoding commented Aug 15, 2018

I made a PR here that should hopefully address the situation that you have in mind:

ansible/tower-cli#592

This falls short of detecting the case where we do not have a template, and the result action is creation. That would still failing confusingly. However, I think that's validation that might be appropriate for the module to do. If a name is provided, but no template is provided, but the name does not exist, that should be a user error of some type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment