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

cloud: Add module for Hashicorp nomad (nomad_job) #29021

Open
wants to merge 26 commits into
base: devel
from

Conversation

Projects
None yet
5 participants
@sirkjohannsen

sirkjohannsen commented Sep 5, 2017

SUMMARY

This module aims to provide basic functionality to manage jobs in Hashicorps cluster scheduler nomad.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

cloud/nomad/nomad_job.py

ANSIBLE VERSION
ansible 2.3.2.0
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 5, 2017

The test ansible-test sanity --test boilerplate [?] failed with the following error:

Command "test/sanity/code-smell/boilerplate.sh" returned exit status 2.
>>> Standard Output
== Missing __metaclass__ = type ==
./lib/ansible/modules/cloud/nomad/nomad_job.py

== Missing from __future__ import (absolute_import, division, print_function) ==
./lib/ansible/modules/cloud/nomad/nomad_job.py

The test ansible-test sanity --test pep8 [?] failed with the following errors:

lib/ansible/modules/cloud/nomad/nomad_job.py:16:161: E501 line too long (199 > 160 characters)
lib/ansible/modules/cloud/nomad/nomad_job.py:16:200: W291 trailing whitespace
lib/ansible/modules/cloud/nomad/nomad_job.py:123:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/nomad/nomad_job.py:155:12: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/nomad/nomad_job.py:310:23: E261 at least two spaces before inline comment
lib/ansible/modules/cloud/nomad/nomad_job.py:310:87: W291 trailing whitespace
lib/ansible/modules/cloud/nomad/nomad_job.py:336:1: W293 blank line contains whitespace

The test ansible-test sanity --test pylint [?] failed with the following error:

lib/ansible/modules/cloud/nomad/nomad_job.py:172:62: undefined-variable Undefined variable 'job'

The test ansible-test sanity --test validate-modules [?] failed with the following errors:

lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E105 GPLv3 license header not found
lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E305 DOCUMENTATION.options.jobdesc.type: not a valid value for dictionary value @ data['options']['jobdesc']['type']. Got 'json'
lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E305 DOCUMENTATION.options.timeout.type: not a valid value for dictionary value @ data['options']['timeout']['type']. Got 'int'
lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E307 version_added should be 2.4. Currently 2.3
lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E316 ANSIBLE_METADATA.metadata_version: not a valid value for dictionary value @ data['metadata_version']. Got '1.0'
lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E319 RETURN.allocations.type: not a valid value for dictionary value @ data['type']. Got 'json'
lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E319 RETURN.evaluation.type: not a valid value for dictionary value @ data['type']. Got 'json'
lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E319 RETURN.job.type: not a valid value for dictionary value @ data['type']. Got 'json'

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 5, 2017

The test ansible-test sanity --test boilerplate [?] failed with the following error:

Command "test/sanity/code-smell/boilerplate.sh" returned exit status 2.
>>> Standard Output
== Missing __metaclass__ = type ==
./lib/ansible/modules/cloud/nomad/nomad_job.py

== Missing from __future__ import (absolute_import, division, print_function) ==
./lib/ansible/modules/cloud/nomad/nomad_job.py

click here for bot help

@mattclay mattclay added the ci_verified label Sep 5, 2017

@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 7, 2017

The test ansible-test sanity --test validate-modules [?] failed with the following error:

lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E307 version_added should be 2.5. Currently 2.4

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 7, 2017

@sirkjohannsen This PR contains @ mentions in at least one commit message. Those mentions can cause cascading notifications through GitHub and need to be removed. Please squash or amend your commits to remove the mentions.

click here for bot help

@ansibot ansibot removed the ci_verified label Sep 7, 2017

@sirkjohannsen sirkjohannsen force-pushed the sirkjohannsen:feat_module_nomad_job branch Sep 7, 2017

@sirkjohannsen sirkjohannsen force-pushed the sirkjohannsen:feat_module_nomad_job branch to 464f66d Sep 7, 2017

@ansibot ansibot removed the stale_ci label Aug 15, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 15, 2018

The test ansible-test sanity --test pylint [explain] failed with 12 errors:

lib/ansible/modules/cloud/nomad/nomad_job.py:208:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:216:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:224:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:232:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:240:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:248:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:256:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:264:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:344:33: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:479:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/cloud/nomad/nomad_job.py:591:45: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:629:30: ansible-format-automatic-specification Format string contains automatic field numbering specification

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

lib/ansible/modules/cloud/nomad/nomad_job.py:165:0: ImportError: cannot import name Counter

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

lib/ansible/modules/cloud/nomad/nomad_job.py:44:161: E501 line too long (165 > 160 characters)
lib/ansible/modules/cloud/nomad/nomad_job.py:329:13: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:468:20: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:471:27: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:476:20: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:476:33: E201 whitespace after '{'
lib/ansible/modules/cloud/nomad/nomad_job.py:479:1: W293 blank line contains whitespace

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

lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E307 version_added should be 2.7. Currently 2.5
lib/ansible/modules/cloud/nomad/nomad_job.py:360:0: E403 Type comparison using type() found. Use isinstance() instead
lib/ansible/modules/cloud/nomad/nomad_job.py:441:0: E403 Type comparison using type() found. Use isinstance() instead
lib/ansible/modules/cloud/nomad/nomad_job.py:568:0: E403 Type comparison using type() found. Use isinstance() instead

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 16, 2018

@sirkjohannsen this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 16, 2018

The test ansible-test sanity --test pylint [explain] failed with 12 errors:

lib/ansible/modules/cloud/nomad/nomad_job.py:208:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:216:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:224:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:232:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:240:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:248:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:256:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:264:12: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:344:33: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:479:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/cloud/nomad/nomad_job.py:591:45: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/cloud/nomad/nomad_job.py:629:30: ansible-format-automatic-specification Format string contains automatic field numbering specification

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

lib/ansible/modules/cloud/nomad/nomad_job.py:165:0: ImportError: cannot import name Counter

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

lib/ansible/modules/cloud/nomad/nomad_job.py:44:161: E501 line too long (165 > 160 characters)
lib/ansible/modules/cloud/nomad/nomad_job.py:329:13: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:468:20: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:471:27: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:476:20: E225 missing whitespace around operator
lib/ansible/modules/cloud/nomad/nomad_job.py:476:33: E201 whitespace after '{'
lib/ansible/modules/cloud/nomad/nomad_job.py:479:1: W293 blank line contains whitespace

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

lib/ansible/modules/cloud/nomad/nomad_job.py:0:0: E307 version_added should be 2.7. Currently 2.5
lib/ansible/modules/cloud/nomad/nomad_job.py:360:0: E403 Type comparison using type() found. Use isinstance() instead
lib/ansible/modules/cloud/nomad/nomad_job.py:441:0: E403 Type comparison using type() found. Use isinstance() instead
lib/ansible/modules/cloud/nomad/nomad_job.py:568:0: E403 Type comparison using type() found. Use isinstance() instead

click here for bot help

momirjalili and others added some commits Aug 16, 2018

Merge pull request #1 from momirjalili/devel
prepare nomad module for merge
@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 16, 2018

@sirkjohannsen this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot ansibot removed the ci_verified label Aug 16, 2018

sirkjohannsen and others added some commits Sep 5, 2017

Bugfix: 'NoneType' has no len()\n
FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_ZS7Lec/ansible_module_nomad_job.py\", line 370, in <module>\n    main()\n  File \"/tmp/ansible_ZS7Lec/ansible_module_nomad_job.py\", line 336, in main\n    num_tasks = len(allocation_info['TaskStates'])\nTypeError: object of type 'NoneType' has no len()\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 16, 2018

@sirkjohannsen this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 16, 2018

@sirkjohannsen this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot ansibot added the stale_ci label Aug 24, 2018

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