Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

modules-extra / cloud / openstack / os_recordset

ANSIBLE VERSION

$ ansible --version
ansible 2.2.0.0
config file = /home/ubuntu/work/playbooks/ansible.cfg
configured module search path = Default w/o overrides

CONFIGURATION

[defaults]
inventory=inventory/openstack.py

[ssh_connection]
pipelining=False

OS / ENVIRONMENT

Ubuntu 16.04. The task uses delegate_to: localhost

SUMMARY

It seems the os_recordset module is unable to create domain records with both A and AAAA records if they both have the same name. This isn't uncommon in IPv4 and IPv6 deployments. I should be able to create both A and AAAA records for the same name.

STEPS TO REPRODUCE

- hosts: testhost
tasks:
- name: Setting up testhost IPv4
delegate_to: localhost
os_recordset:
cloud: dev
state: present
zone: "example.com."
name: "www"
recordset_type: A
records: "{{ openstack.accessIPv4 }}"
ttl: 3600
- name: Setting up testhost IPv6
delegate_to: localhost
os_recordset:
cloud: dev
state: present
zone: "example.com."
name: "www"
recordset_type: AAAA
records: "{{ openstack.accessIPv6 }}"
ttl: 3600

EXPECTED RESULTS

I would expect both A and AAAA records to be created without error.

ACTUAL RESULTS

Creating A/AAAA record and both an A and AAAA records already exist in OpenStack:

TASK [Setting up testhost IPv4] ************************************************
fatal: [www.example.com -> localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Unable to create recordset www (Inner Exception: Duplicate RecordSet)"}

Creating A record and only an AAAA record already exists in OpenStack:

TASK [Setting up testhost IPv4] ************************************************
fatal: [www.example.com -> localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error updating recordset www.example.com. (Inner Exception: u'10.0.0.1' is not a 'ipv6')"}

Verbose on:

fatal: [www.example.com -> localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"api_timeout": null,
"auth": null,
"auth_type": null,
"availability_zone": null,
"cacert": null,
"cert": null,
"cloud": "dev",
"description": null,
"endpoint_type": "public",
"key": null,
"name": "www",
"records": [
"10.0.0.1"
],
"recordset_type": "A",
"region_name": null,
"state": "present",
"timeout": 180,
"ttl": 3600,
"verify": true,
"wait": true,
"zone": "example.com."
},
"module_name": "os_recordset"
},
"msg": "Error updating recordset www.example.com. (Inner Exception: u'10.0.0.1' is not a 'ipv6')"
}

Creating an AAAA record and an A record already exists in OpenStack

"msg": "Error updating recordset www.example.com. (Inner Exception: u'<ipv6 address removed>' is not a 'ipv4')"

Issue 2:
Ansible URI module remove plus sign when we do a post method call.

Am using credential API to create credentials in Jenkins. My payload has the attribute which carries SSH private key. am using ansible vault to store my key and feeding my vault variable to the payload.

Am getting successful response and even the credentials are created in jenkins.

However it removes the plus (+) sign from the credential.

Note: am using header

headers:
Content-Type: "application/x-www-form-urlencoded"

My Request:

- name: configure gerrit credential
uri:
url: https://ipaddress/credentials/store/system/domain/_/createCredentials
method: POST
headers:
Content-Type: "x-www-form-urlencoded"
body: 'json={
"": "0",
"credentials": {
"scope": "GLOBAL",
"id": "AADO-Jenkins-gerrit-ssh-credentials",
"username": "Jenkins-test",
"passphrase": "{{ jenkins_passphrase }}",
"privateKeySource": {
"stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource",
"privateKey": "-----BEGIN RSA PRIVATE KEY-----\nABCCC+cccd+fff\n-----END RSA PRIVATE KEY-----\n"
},
"description": "apicredentials",
"stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey"
}
}'
validate_certs: no
follow_redirects: yes
register: login
return_content: yes

Output:

In jenkins the credential are stored as

-----BEGIN RSA PRIVATE KEY-----

ABCCC cccd fff

-----END RSA PRIVATE KEY-----

It removes the plus(+) sign and added spaces