Skip to content
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 new net_tools module for fly ADN #33078

Open
wants to merge 4 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@andy-pi
Copy link
Contributor

andy-pi commented Nov 20, 2017

SUMMARY

New module Fly allows users to create hostnames, link backends and add rules using Application Delvivery Network Fly's API.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

fly

ANSIBLE VERSION
ansible 2.4.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible']
  ansible python module location = /home/ubuntu/workspace/ansible-roles/env/lib/python3.5/site-packages/ansible
  executable location = /home/ubuntu/workspace/ansible-roles/env/bin/ansible
  python version = 3.5.1 (default, Dec 18 2015, 00:00:00) [GCC 4.8.4]
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Nov 20, 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/net_tools/fly.py

== Missing from __future__ import (absolute_import, division, print_function) ==
./lib/ansible/modules/net_tools/fly.py

The test ansible-test sanity --test no-wildcard-import [?] failed with the following error:

Command "test/sanity/code-smell/no-wildcard-import.sh" returned exit status 3.
>>> Standard Output
== Wildcard imports detected ==
./lib/ansible/modules/net_tools/fly.py:from ansible.module_utils.basic import *
./lib/ansible/modules/net_tools/fly.py:from ansible.module_utils.urls import *

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

lib/ansible/modules/net_tools/fly.py:17:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:51:24: W291 trailing whitespace
lib/ansible/modules/net_tools/fly.py:89:10: W291 trailing whitespace
lib/ansible/modules/net_tools/fly.py:93:161: E501 line too long (364 > 160 characters)
lib/ansible/modules/net_tools/fly.py:103:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/net_tools/fly.py:112:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:113:28: W291 trailing whitespace
lib/ansible/modules/net_tools/fly.py:118:16: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:118:27: E201 whitespace after '{'
lib/ansible/modules/net_tools/fly.py:118:43: E201 whitespace after '{'
lib/ansible/modules/net_tools/fly.py:118:64: E202 whitespace before '}'
lib/ansible/modules/net_tools/fly.py:118:66: E202 whitespace before '}'
lib/ansible/modules/net_tools/fly.py:118:68: E202 whitespace before '}'
lib/ansible/modules/net_tools/fly.py:119:34: E231 missing whitespace after ':'
lib/ansible/modules/net_tools/fly.py:119:85: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:120:28: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:120:42: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:120:58: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:120:79: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:123:57: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:123:59: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:128:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:129:5: E303 too many blank lines (2)
lib/ansible/modules/net_tools/fly.py:129:29: W291 trailing whitespace
lib/ansible/modules/net_tools/fly.py:134:34: E231 missing whitespace after ':'
lib/ansible/modules/net_tools/fly.py:134:85: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:135:13: W291 trailing whitespace
lib/ansible/modules/net_tools/fly.py:136:32: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:136:45: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:136:61: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:139:61: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:139:63: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:152:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:154:34: E231 missing whitespace after ':'
lib/ansible/modules/net_tools/fly.py:154:85: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:156:29: E201 whitespace after '{'
lib/ansible/modules/net_tools/fly.py:156:45: E201 whitespace after '{'
lib/ansible/modules/net_tools/fly.py:159:21: E124 closing bracket does not match visual indentation
lib/ansible/modules/net_tools/fly.py:159:22: E202 whitespace before '}'
lib/ansible/modules/net_tools/fly.py:159:24: E202 whitespace before '}'
lib/ansible/modules/net_tools/fly.py:160:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:161:28: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:161:42: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:161:58: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:161:79: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:164:51: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:164:53: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:168:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:169:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:170:5: E303 too many blank lines (2)
lib/ansible/modules/net_tools/fly.py:170:25: W291 trailing whitespace
lib/ansible/modules/net_tools/fly.py:175:58: E261 at least two spaces before inline comment
lib/ansible/modules/net_tools/fly.py:176:44: E261 at least two spaces before inline comment
lib/ansible/modules/net_tools/fly.py:177:43: E711 comparison to None should be 'if cond is None:'
lib/ansible/modules/net_tools/fly.py:180:21: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:181:51: E711 comparison to None should be 'if cond is None:'
lib/ansible/modules/net_tools/fly.py:184:29: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:186:34: E231 missing whitespace after ':'
lib/ansible/modules/net_tools/fly.py:186:85: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:187:29: E201 whitespace after '{'
lib/ansible/modules/net_tools/fly.py:188:31: E126 continuation line over-indented for hanging indent
lib/ansible/modules/net_tools/fly.py:192:52: W291 trailing whitespace
lib/ansible/modules/net_tools/fly.py:194:21: E126 continuation line over-indented for hanging indent
lib/ansible/modules/net_tools/fly.py:194:22: E202 whitespace before '}'
lib/ansible/modules/net_tools/fly.py:194:24: E202 whitespace before '}'
lib/ansible/modules/net_tools/fly.py:195:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:196:28: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:196:42: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:196:58: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:196:79: E231 missing whitespace after ','
lib/ansible/modules/net_tools/fly.py:199:57: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:199:59: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:209:25: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:210:29: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
lib/ansible/modules/net_tools/fly.py:235:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:236:21: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/net_tools/fly.py:240:1: W293 blank line contains whitespace
lib/ansible/modules/net_tools/fly.py:244:27: W291 trailing whitespace

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

lib/ansible/modules/net_tools/fly.py:112:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:113:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:125:12: undefined-variable Undefined variable 'error_msg'
lib/ansible/modules/net_tools/fly.py:125:99: undefined-variable Undefined variable 'content'
lib/ansible/modules/net_tools/fly.py:128:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:129:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:135:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:141:16: undefined-variable Undefined variable 'error_msg'
lib/ansible/modules/net_tools/fly.py:141:103: undefined-variable Undefined variable 'content'
lib/ansible/modules/net_tools/fly.py:152:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:160:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:166:12: undefined-variable Undefined variable 'error_msg'
lib/ansible/modules/net_tools/fly.py:166:99: undefined-variable Undefined variable 'content'
lib/ansible/modules/net_tools/fly.py:168:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:169:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:170:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:177:11: singleton-comparison Comparison to None should be 'expr is None'
lib/ansible/modules/net_tools/fly.py:181:11: singleton-comparison Comparison to None should be 'expr is None'
lib/ansible/modules/net_tools/fly.py:192:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:195:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:201:12: undefined-variable Undefined variable 'error_msg'
lib/ansible/modules/net_tools/fly.py:201:99: undefined-variable Undefined variable 'content'
lib/ansible/modules/net_tools/fly.py:210:11: singleton-comparison Comparison to False should be 'not expr' or 'expr is False'
lib/ansible/modules/net_tools/fly.py:240:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/net_tools/fly.py:244:0: trailing-whitespace Trailing whitespace

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

lib/ansible/modules/net_tools/fly.py:0:0: E307 version_added should be 2.5. Currently 1.0
lib/ansible/modules/net_tools/fly.py:44:3: E311 EXAMPLES is not valid YAML
lib/ansible/modules/net_tools/fly.py:79:1: E313 RETURN is not valid YAML
lib/ansible/modules/net_tools/fly.py:97:0: E208 module_utils imports should import specific components, not "*"
lib/ansible/modules/net_tools/fly.py:98:0: E208 module_utils imports should import specific components, not "*"

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Nov 21, 2017

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

lib/ansible/modules/net_tools/fly.py:127:18: E225 missing whitespace around operator
lib/ansible/modules/net_tools/fly.py:192:31: E126 continuation line over-indented for hanging indent
lib/ansible/modules/net_tools/fly.py:198:21: E126 continuation line over-indented for hanging indent

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

lib/ansible/modules/net_tools/fly.py:0:0: E319 RETURN.add_backend.type: not a valid value for dictionary value @ data['type']. Got 'json'
lib/ansible/modules/net_tools/fly.py:0:0: E319 RETURN.add_rule.type: not a valid value for dictionary value @ data['type']. Got 'json'
lib/ansible/modules/net_tools/fly.py:0:0: E319 RETURN.create_hostname.type: not a valid value for dictionary value @ data['type']. Got 'json'
lib/ansible/modules/net_tools/fly.py:0:0: E319 RETURN.view_hostname.type: not a valid value for dictionary value @ data['type']. Got 'json'
lib/ansible/modules/net_tools/fly.py:6:0: E106 Import found before documentation variables. All imports must appear below DOCUMENTATION/EXAMPLES/RETURN/ANSIBLE_METADATA.
lib/ansible/modules/net_tools/fly.py:6:0: E107 Imports should be directly below DOCUMENTATION/EXAMPLES/RETURN/ANSIBLE_METADATA.

click here for bot help

@ansibot ansibot added ci_verified and removed ci_verified labels Nov 21, 2017

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Nov 21, 2017

The test ansible-test sanity --test import --python 2.6 [?] failed with the following error:

lib/ansible/modules/net_tools/fly.py:105:0: SyntaxError: from __future__ imports must occur at the beginning of the file

The test ansible-test sanity --test import --python 2.7 [?] failed with the following error:

lib/ansible/modules/net_tools/fly.py:105:0: SyntaxError: from __future__ imports must occur at the beginning of the file

The test ansible-test sanity --test import --python 3.5 [?] failed with the following error:

lib/ansible/modules/net_tools/fly.py:105:0: SyntaxError: from __future__ imports must occur at the beginning of the file

The test ansible-test sanity --test import --python 3.6 [?] failed with the following error:

lib/ansible/modules/net_tools/fly.py:105:0: SyntaxError: from __future__ imports must occur at the beginning of the file

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

lib/ansible/modules/net_tools/fly.py:197:20: E124 closing bracket does not match visual indentation

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

lib/ansible/modules/net_tools/fly.py:105:0: misplaced-future __future__ import is not the first non docstring statement

click here for bot help

@ansibot ansibot added the ci_verified label Nov 21, 2017

@ansibot ansibot removed the ci_verified label Nov 21, 2017

@andy-pi andy-pi force-pushed the andy-pi:devel branch to 154c9dc Nov 21, 2017

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Nov 21, 2017

@akostyuk @alcamie101 @andyhky @briceburg @drcapulet @jpmens @jtyr @mgruener @mpdehaan @nerzhul @ogenstad @ravibhure @romeotheriault

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@andy-pi

This comment has been minimized.

Copy link
Contributor Author

andy-pi commented Nov 21, 2017

For further info please see the article I wrote on the use of this module. This PR is a revised version of the module from my personal repo which the article links to.
https://fly.io/articles/automating-deployment-using-flys-api-and-ansible-2/

@ansibot ansibot added the stale_ci label Nov 29, 2017

@andy-pi

This comment has been minimized.

Copy link
Contributor Author

andy-pi commented Dec 20, 2017

bot_status

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Dec 20, 2017

Components

lib/ansible/modules/net_tools/fly.py
support: community
maintainers:

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 0
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 0
shipit_actors (maintainer or core team member): []
shipit_actors_other: []

click here for bot help

@andy-pi

This comment has been minimized.

Copy link
Contributor Author

andy-pi commented Jan 18, 2018

@akostyuk @alcamie101 @andyhky @briceburg @drcapulet @jpmens @jtyr @mgruener @mpdehaan @nerzhul @ogenstad @ravibhure @romeotheriault
Any chance anyone can help review this new module? Or give some advice if it needs reworking?

@andy-pi

This comment has been minimized.

Copy link
Contributor Author

andy-pi commented Feb 27, 2018

@akostyuk @alcamie101 @andyhky @briceburg @drcapulet @jpmens @jtyr @mgruener @mpdehaan @nerzhul @ogenstad @ravibhure @romeotheriault

Hoping to get this merged! Any module maintainers who can help review and approve this new module I'll send $15 by PayPal as a small token of appreciation when it is successfully merged.

@abadger abadger removed the python3 label Mar 20, 2018

@maxamillion

This comment has been minimized.

Copy link
Contributor

maxamillion commented Jun 19, 2018

@andy-pi thank you for the PR! Sorry again about the lag time on this.

Out of curiosity, is there any means via the API to make this module perform idempotent tasks and support check_mode? and any chance you could have tests? .... I know integration tests aren't likely because we don't have credentials but unit tests would be good if you don't mind.

and finally, we're looking to do changelogs with all new noteworthy PRs such as new modules, how-to below

How to

A basic changelog fragment is a .yaml file placed in the
changelogs/fragments/ directory. Each file contains a yaml dict with
keys like "bugfixes" or "major_changes" followed by a list of
changelog entries of bugfixes or features. Each changelog entry is
rst embedded inside of the yaml file which means that certain
constructs would need to be escaped so they can be interpreted by rst
and not by yaml (or escaped for both yaml and rst if that's your
desire). Each PR should use a new fragment file rather than adding to
an existing one.

Here's an example of a changelog fragment for a bugfix:

---
bugfixes:
- copy module - The copy module was attempting to change the mode of files for
  remote_src=True even if mode was not set as a parameter.  This failed on
  filesystems which do not have permission bits
(https://github.com/ansible/ansible/pull/40099)

You can find more example changelog fragments in the changelog
directory for a previous release:
https://github.com/ansible/ansible/tree/stable-2.6/changelogs/fragments

You can also find documentation of the format including hints on
embedding rst in the yaml in the reno documentation:
https://docs.openstack.org/reno/latest/user/usage.html#editing-a-release-note

The toplevel keys (bugfixes, major_changes, etc) are defined in the
config file for our release note tool. You can find the keys
recognized for the current release here:
https://github.com/ansible/ansible/blob/devel/changelogs/config.yaml#L6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.