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

1.0.7 Release #70

Open
wants to merge 76 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
701aeea
Enhanced Inventory (#3)
willtome Feb 29, 2020
15a7594
Update version for Galaxy
amittell Feb 29, 2020
5de6a46
Fix README
amittell Mar 2, 2020
26a97e4
Added support for specifying custom service now domain. (#5)
Akasurde Mar 3, 2020
1ad03af
Autopep8 + remove unused sys module
amittell Mar 3, 2020
845101f
Merge pull request #6 from ServiceNowITOM/clean_up_pep_issues
willtome Apr 7, 2020
74aafd7
Collection Migration (#8)
willtome Apr 23, 2020
eb12bb0
adding changelog
willtome May 1, 2020
ca48e4e
update version to 1.1.0
willtome May 4, 2020
49bb53f
Enhanced Inventory (#3)
willtome Feb 29, 2020
4962144
Update version for Galaxy
amittell Feb 29, 2020
b20fe17
Fix README
amittell Mar 2, 2020
5b54717
Added support for specifying custom service now domain. (#5)
Akasurde Mar 3, 2020
b2bb380
Autopep8 + remove unused sys module
amittell Mar 3, 2020
c587373
Collection Migration (#8)
willtome Apr 23, 2020
56dab4d
adding changelog
willtome May 1, 2020
849cf0b
update version to 1.1.0
willtome May 4, 2020
3b9fe17
Merge branch 'master' into devel
willtome May 4, 2020
8c64cab
Merge branch 'devel' of github.com:ServiceNowITOM/servicenow-ansible …
willtome May 4, 2020
0b3de83
fix for ansible-test
willtome May 4, 2020
750e24a
fix for ansible-test
willtome May 4, 2020
622fff1
fix version #
willtome May 4, 2020
452a47b
add CI badge
willtome May 4, 2020
01d1d9b
Add Docs (#13)
willtome May 19, 2020
ae1ed4c
Add release automation (#16)
willtome Jun 23, 2020
eabee69
Remove unrecognized keyword (#15)
willtome Jun 23, 2020
05e83f9
update namespace
willtome Jun 23, 2020
bb7bd66
Update inventory to use same auth parameters as modules (#19)
willtome Aug 22, 2020
af07c55
Add antsibull-changelog (#24)
willtome Sep 9, 2020
426ba30
merge from master
willtome Sep 9, 2020
f4d9bf2
remove old changelog
willtome Sep 9, 2020
265556a
Update docs (#30)
Akasurde Oct 13, 2020
072dc6c
Fix hostname transformation (#26)
willtome Oct 16, 2020
1fb9dea
add bug fixes
willtome Oct 16, 2020
e54c2bb
add runtime.yml
willtome Oct 16, 2020
49132f2
reduce line length
willtome Oct 16, 2020
12105aa
trailing whitespace
willtome Oct 16, 2020
13402e3
update release date
willtome Oct 30, 2020
d7557ff
Support for python dependencies in Ansible Execution Envs" (#39)
termlen0 Dec 4, 2020
7b966b7
Support API parameters and Pysnow resource API (0.6-0.7) (#37)
nesies Feb 2, 2021
dd34a73
Update CHANGELOG.rst
amittell Feb 2, 2021
11c958e
Merge branch 'main' into devel
amittell Feb 2, 2021
c83cf6c
update changelog
willtome Feb 3, 2021
fc8b46d
ISSUE 27 Support OpenID Connect protocol (#47)
n3pjk Mar 23, 2021
feb708e
1.0.5 Release
willtome Apr 2, 2021
0345be4
resolve conflicts
willtome Apr 2, 2021
7c50fbd
resolve conflicts
willtome Apr 2, 2021
0b362ae
Issue 58 - Make auth backwards compatible and fix order_by (#59)
n3pjk Apr 30, 2021
8211d31
Update changelog for v1.0.6
amittell May 25, 2021
359b150
Update for v1.0.6
amittell May 25, 2021
dc595a8
Update CHANGELOG.rst
amittell May 25, 2021
beac0d6
v1.0.6 changelog updates
amittell May 25, 2021
12bc3db
Merge branch 'main' into devel
amittell May 25, 2021
209d1e4
fix pep8/pylint issues
amittell May 25, 2021
85f9071
fix pep8/pylint issues
amittell May 25, 2021
aa2e6f8
add support for host vars from fields in related tables (#45)
May 28, 2021
b7f3dd7
Add SN_FILTER_RESULTS env settings. (#64)
HampusLundqvist Aug 31, 2021
7fa688d
add deprecation notice (#69)
willtome Sep 13, 2021
cc65b57
update changelog
willtome Sep 13, 2021
0e4361e
update changelog
willtome Sep 13, 2021
97e11f6
Merge branch 'main' into devel
willtome Sep 13, 2021
cc0d73b
fix changelog
willtome Sep 13, 2021
63bcc5f
fix changelog
willtome Sep 13, 2021
4e6be0d
update deprectaion notices
willtome Oct 25, 2021
475dc3f
update tests
willtome Oct 25, 2021
3a86416
update tests
willtome Oct 25, 2021
736d5f6
update runtime.yml
willtome Oct 25, 2021
64292da
update runtime.yml
willtome Oct 25, 2021
ed8b93c
update runtime.yml
willtome Oct 25, 2021
9abaaa5
Update now.yml
dingarim Apr 10, 2023
25e1f3c
Update now.yml
dingarim Apr 10, 2023
f95c7bd
Update module_test.yml
dingarim Apr 10, 2023
9b6b4db
Update module_test_cmdb_ci_server.yml
dingarim Apr 10, 2023
3c90ed0
Update network.enhanced.now.yml
dingarim Apr 10, 2023
90f1eba
Update now.yml.sample
dingarim Apr 10, 2023
cc9ac73
Update enhanced.now.yml
dingarim Apr 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs (#30)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
  • Loading branch information
Akasurde authored Oct 13, 2020
commit 265556a495f3a43e522b3a129d4aa45e3431081d
26 changes: 18 additions & 8 deletions plugins/inventory/now.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#
# Copyright: (c), Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
import netaddr
from ansible.errors import AnsibleError, AnsibleParserError
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable, to_safe_group_name
__metaclass__ = type
DOCUMENTATION = '''

DOCUMENTATION = r'''
name: servicenow.servicenow.now
plugin_type: inventory
author:
@@ -12,7 +15,7 @@
short_description: ServiceNow Inventory Plugin
version_added: "2.10"
description:
- ServiceNow Inventory plugin
- ServiceNow Inventory plugin.
extends_documentation_fragment:
- constructed
- inventory_cache
@@ -59,7 +62,7 @@
env:
- name: SN_PASSWORD
table:
description: The ServiceNow table to query
description: The ServiceNow table to query.
type: string
default: cmdb_ci_server
fields:
@@ -89,7 +92,8 @@

'''

EXAMPLES = '''
EXAMPLES = r'''
# Simple Inventory Plugin example
plugin: servicenow.servicenow.now
instance: dev89007
username: admin
@@ -99,6 +103,7 @@
prefix: ''
separator: ''

# Using Keyed Groups
plugin: servicenow.servicenow.now
host: servicenow.mydomain.com
username: admin
@@ -116,6 +121,7 @@
- key: sn_install_status | lower
prefix: 'status'

# Compose hostvars
plugin: servicenow.servicenow.now
instance: dev89007
username: admin
@@ -131,12 +137,16 @@
prefix: 'tag'
'''

import netaddr
try:
import requests
HAS_REQUESTS = True
except ImportError:
HAS_REQUESTS = False

from ansible.errors import AnsibleError, AnsibleParserError
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable, to_safe_group_name


class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):

@@ -171,7 +181,7 @@ def invoke(self, verb, path, data):
# build url
self.url = "https://%s/%s" % (fqdn, path)
url = self.url
self.display.vvv("Connecting to...%s" % (url))
self.display.vvv("Connecting to...%s" % url)
results = []

if not self.update_cache:
27 changes: 11 additions & 16 deletions plugins/modules/snow_record.py
Original file line number Diff line number Diff line change
@@ -7,13 +7,8 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}

DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: snow_record
short_description: Manage records in ServiceNow
@@ -65,9 +60,9 @@

'''

EXAMPLES = '''
EXAMPLES = r'''
- name: Grab a user record
snow_record:
servicenow.servicenow.snow_record:
username: ansible_test
password: my_password
instance: dev99999
@@ -77,7 +72,7 @@
lookup_field: sys_id

- name: Grab a user record using OAuth
snow_record:
servicenow.servicenow.snow_record:
username: ansible_test
password: my_password
client_id: "1234567890abcdef1234567890abcdef"
@@ -89,7 +84,7 @@
lookup_field: sys_id

- name: Create an incident
snow_record:
servicenow.servicenow.snow_record:
username: ansible_test
password: my_password
instance: dev99999
@@ -101,7 +96,7 @@
register: new_incident

- name: Create an incident using host instead of instance
snow_record:
servicenow.servicenow.snow_record:
username: ansible_test
password: my_password
host: dev99999.mycustom.domain.com
@@ -111,15 +106,15 @@
priority: 2

- name: Delete the record we just made
snow_record:
servicenow.servicenow.snow_record:
username: admin
password: xxxxxxx
instance: dev99999
state: absent
number: "{{new_incident['record']['number']}}"

- name: Delete a non-existant record
snow_record:
servicenow.servicenow.snow_record:
username: ansible_test
password: my_password
instance: dev99999
@@ -128,7 +123,7 @@
failed_when: false

- name: Update an incident
snow_record:
servicenow.servicenow.snow_record:
username: ansible_test
password: my_password
instance: dev99999
@@ -138,7 +133,7 @@
work_notes : "Been working all day on this thing."

- name: Attach a file to an incident
snow_record:
servicenow.servicenow.snow_record:
username: ansible_test
password: my_password
instance: dev99999
@@ -148,7 +143,7 @@
tags: attach
'''

RETURN = '''
RETURN = r'''
record:
description: Record data from Service Now
type: dict
20 changes: 7 additions & 13 deletions plugins/modules/snow_record_find.py
Original file line number Diff line number Diff line change
@@ -7,13 +7,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}

DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: snow_record_find
short_description: Search for multiple records from ServiceNow
@@ -60,9 +54,9 @@

'''

EXAMPLES = '''
EXAMPLES = r'''
- name: Search for incident assigned to group, return specific fields
snow_record_find:
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
instance: dev99999
@@ -74,7 +68,7 @@
- opened_at

- name: Search for incident using host instead of instance
snow_record_find:
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
host: dev99999.mycustom.domain.com
@@ -86,7 +80,7 @@
- opened_at

- name: Using OAuth, search for incident assigned to group, return specific fields
snow_record_find:
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
client_id: "1234567890abcdef1234567890abcdef"
@@ -100,7 +94,7 @@
- opened_at

- name: Find open standard changes with my template
snow_record_find:
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
instance: dev99999
@@ -127,7 +121,7 @@
- short_description
'''

RETURN = '''
RETURN = r'''
record:
description: The full contents of the matching ServiceNow records as a list of records.
type: dict