Skip to content

Commit

Permalink
1.0.5 Release (#53)
Browse files Browse the repository at this point in the history
* Enhanced Inventory (#3)

* add enhanced mode to inventory. update readme.

* throw error if update set not installed

* Update version for Galaxy

* Fix README

* Added support for specifying custom service now domain. (#5)

Fixes: ansible/ansible#62018

Signed-off-by: Abhijeet Kasurde <[email protected]>

* Autopep8 + remove unused sys module

* Collection Migration (#8)

Check for missing commits vs ansible/ansible devel

* adding changelog

* update version to 1.1.0

* Enhanced Inventory (#3)

* add enhanced mode to inventory. update readme.

* throw error if update set not installed

* Update version for Galaxy

* Fix README

* Added support for specifying custom service now domain. (#5)

Fixes: ansible/ansible#62018

Signed-off-by: Abhijeet Kasurde <[email protected]>

* Autopep8 + remove unused sys module

* Collection Migration (#8)

Check for missing commits vs ansible/ansible devel

* adding changelog

* update version to 1.1.0

* fix for ansible-test

* fix for ansible-test

* fix version #

* add CI badge

* Add Docs (#13)

* add docs for inventory plugin

* add docs for modules

* Add release automation (#16)

* add release automation

* fix for CI. duplicate fix from PR #15. Closes issue #14

* Remove unrecognized keyword  (#15)

* remove unrecognized keyword. issue #14

* fix CI

* update namespace

* Update inventory to use same auth parameters as modules (#19)

* Add antsibull-changelog (#24)

* add changelog

* remove old changelog

* Update docs (#30)

Signed-off-by: Abhijeet Kasurde <[email protected]>

* Fix hostname transformation (#26)

* fix for issue 22

* fix transform host names

* fix changelog

* add bug fixes

* add runtime.yml

* reduce line length

* trailing whitespace

* update release date

* Support for python dependencies in Ansible Execution Envs" (#39)

Thanks for the PR!

* Support API parameters and Pysnow resource API (0.6-0.7) (#37)

* new tests search with no result, parameters display_value

* add support parameters display_value exclude_reference_link and new pysnow API (0.6-0.7):

* add support parameters display_value exclude_reference_link and new pysnow API (0.6-0.7)

* changelog fragments

Co-authored-by: nesies <>

* Update CHANGELOG.rst

* update changelog

* ISSUE 27 Support OpenID Connect protocol (#47)

Co-authored-by: Paul Knight <[email protected]>
Co-authored-by: Boyle, Patrick J. (DTI) <[email protected]>

* 1.0.5 Release

* resolve conflicts

Co-authored-by: amittell <[email protected]>
Co-authored-by: Abhijeet Kasurde <[email protected]>
Co-authored-by: Ajay Chenampara <[email protected]>
Co-authored-by: nesies <[email protected]>
Co-authored-by: n3pjk <[email protected]>
Co-authored-by: Paul Knight <[email protected]>
Co-authored-by: Boyle, Patrick J. (DTI) <[email protected]>
  • Loading branch information
8 people authored Apr 6, 2021
1 parent fe8f133 commit 6c0a3c6
Show file tree
Hide file tree
Showing 11 changed files with 883 additions and 246 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
tests/output
*.tar.gz
galaxy.yml
release.retry

# Created by https://www.gitignore.io/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
# Edit at https://www.gitignore.io/?templates=git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ Servicenow.Servicenow Release Notes
.. contents:: Topics


v1.0.5
======

Major Changes
-------------

- refactored client to inherit from AnsibleModule
- supports OpenID Connect authentication protocol
- supports bearer tokens for authentication

Minor Changes
-------------

- standardized invocation output

Breaking Changes / Porting Guide
--------------------------------

- auth field now required for anything other than Basic authentication

v1.0.4
======

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This collection provides a series of Ansible modules, roles, and plugins for int
## Requirements
- ansible version >= 2.9
- pysnow
- requests
- netaddr

## Installation
Expand Down
3 changes: 1 addition & 2 deletions changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ plugins:
name: snow_record_find
namespace: ''
version_added: null
netconf: {}
shell: {}
strategy: {}
vars: {}
version: 1.0.4
version: 1.0.5
13 changes: 13 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,16 @@ releases:
- 34_pysnow_0.6.yml
- 35_add_new_parameters.yml
release_date: '2021-02-03'
1.0.5:
changes:
breaking_changes:
- auth field now required for anything other than Basic authentication
major_changes:
- refactored client to inherit from AnsibleModule
- supports OpenID Connect authentication protocol
- supports bearer tokens for authentication
minor_changes:
- standardized invocation output
fragments:
- 27_openid.yml
release_date: '2021-04-02'
63 changes: 61 additions & 2 deletions plugins/doc_fragments/service_now.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ class ModuleDocFragment(object):
# Parameters for Service Now modules
DOCUMENTATION = r'''
options:
auth:
description:
- The method used to authenticate with the Service Now instance.
- Basic authentication uses user name and password.
- OAuth authentication uses a client id and secret in addition to Basic authentication.
- Token authentication uses a bearer token in addition to OAuth authentication.
- OpenID Connect authentication, an extension of OAuth 2.0, uses a provider, like Okta, to obtain a bearer token.
- If the vaule is not specified in the task, the value of environment variable C(SN_AUTH) will be used instead.
choices: ['basic', 'oauth', 'token', 'openid']
type: str
default: basic
raise_on_empty:
description:
- If set to false, will not cause a SNOW method to raise an exception should it return no records.
- This is particurlarly useful in snow_record_find, when not sure if any record exists.
type: bool
default: True
log_level:
description:
- Set the logging level of the module
choices: ['debug', 'info', 'normal']
type: str
default: normal
instance:
description:
- The ServiceNow instance name, without the domain, service-now.com.
Expand All @@ -26,25 +49,61 @@ class ModuleDocFragment(object):
username:
description:
- Name of user for connection to ServiceNow.
- Required whether using Basic or OAuth authentication.
- Required whether using Basic, OAuth or OpenID authentication.
- If the value is not specified in the task, the value of environment variable C(SN_USERNAME) will be used instead.
required: false
type: str
password:
description:
- Password for username.
- Required whether using Basic or OAuth authentication.
- Required whether using Basic, OAuth or OpenID authentication.
- If the value is not specified in the task, the value of environment variable C(SN_PASSWORD) will be used instead.
required: false
type: str
client_id:
description:
- Client ID generated by ServiceNow.
- Required when using OAuth or OpenID authentication, unless token is specified.
- If the value is not specified in the task, the value of environment variable C(SN_CLIENTID) will be used instead.
required: false
type: str
client_secret:
description:
- Client Secret associated with client id.
- Required when using OAuth or OpenID authentication, unless token is specified.
- If the value is not specified in the task, the value of environment variable C(SN_CLIENTSECRET) will be used instead.
required: false
type: str
token:
description:
- Bearer token associated with client id and secret.
- Can be used in place of client id and secret for OpenID authentication.
- If the value is not specified in the task, the value of environment variable C(SN_TOKEN) will be used instead.
required: false
type: str
openid_issuer:
description:
- The URL for your organization's OpenID Connect provider.
- Okta, an OpenID provider, supports Single Sign-On with a url like 'https://yourorg.oktapreview.com/oauth2'.
- Okta supports application-level authentication using a url like 'https://yourorg.oktapreview.com/oauth2/TH151s50m3L0ngSTr1NG'.
- If the value is not specified in the task, the value of environment variable C(OPENID_ISSUER) will be used instead.
required: false
type: str
openid_scope:
description:
- A list of scopes to be included in the access token.
- Supported scopes for this application are address, email, groups, openid, phone, profile, of which, openid must be one.
- If the value is not specified in the task, the value of environment variable C(OPENID_SCOPE) will be used instead.
required: false
type: list
elements: str
default: ['openid']
openid:
description:
- If the result of a previous SNOW method, using OpenID, was registered, supply the C(openid) key, from the result.
- The C(openid) key contains a dictionary with the bearer token, which, if still valid, can be reused.
- If the bearer token is no longer valid, the dictionary includes all of the previously supplied C(openid_) fields needed to make a new token request.
- Any other credentials previously supplied, must be provided again.
required: false
type: dict
'''
10 changes: 8 additions & 2 deletions plugins/inventory/now.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
- constructed
- inventory_cache
requirements:
- requests
- python requests (requests)
- netaddr
options:
plugin:
description: The name of the ServiceNow Inventory Plugin, this should always be 'servicenow.servicenow.now'.
Expand Down Expand Up @@ -138,7 +139,12 @@
prefix: 'tag'
'''

import netaddr
try:
import netaddr
HAS_NETADDR = True
except ImportError:
HAS_NETADDR = False

try:
import requests
HAS_REQUESTS = True
Expand Down
Loading

0 comments on commit 6c0a3c6

Please sign in to comment.