Bug 1733547 - [ansible-freeipa] Last suffix adding twice in the list of topology segments
Summary: [ansible-freeipa] Last suffix adding twice in the list of topology segments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ansible-freeipa
Version: 8.1
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Thomas Woerner
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-26 13:33 UTC by Varun Mylaraiah
Modified: 2019-11-05 21:08 UTC (History)
0 users

Fixed In Version: ansible-freeipa-0.1.6-3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 21:08:48 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3418 None None None 2019-11-05 21:08:57 UTC

Description Varun Mylaraiah 2019-07-26 13:33:12 UTC
Description of problem:
Last suffix adding twice in the list of topology segments(suffix: domain+ca)

Version-Release number of selected component (if applicable):
ansible-freeipa-0.1.6-2.el8.noarch

Steps to Reproduce:
Create add-topologysegments.yml with both suffixes (domain+ca)
   Example:ipatopology_segments:
           - {suffix: domain+ca, left: ipareplica3.test.local, right: ipareplica4.test.local}

Actual results:
New segment added only for CA. the domain is failed to add.

Expected results:
The new segment should add to both CA and Domain.

Additional info:
# cat add-topologysegments.yml
---
- name: Add topology segments
  hosts: ipaserver
  become: true
  gather_facts: false

  vars:
    ipatopology_segments:
    - {suffix: domain+ca, left: ipareplica3.test.local, right: ipareplica4.test.local}

  tasks:
  - name: Add topology segment
    ipatopologysegment:
      ipaadmin_password: <xxxxxxxxxx>
      suffix: "{{ item.suffix }}"
      name: "{{ item.name | default(omit) }}"
      left: "{{ item.left }}"
      right: "{{ item.right }}"
      state: present
    loop: "{{ ipatopology_segments | default([]) }}"


[root@auto-hv-02-guest08 ~]# ansible-playbook -vv -i inventory/hosts.topologysegment add-topologysegments.yml 
ansible-playbook 2.8.2
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.6.8 (default, Jul  3 2019, 10:59:07) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]
No config file found; using defaults

PLAYBOOK: add-topologysegments.yml **********************************************************************************
1 plays in add-topologysegments.yml

PLAY [Add topology segments] ****************************************************************************************
META: ran handlers

TASK [Add topology segment] *****************************************************************************************
task path: /root/add-topologysegments.yml:12
failed: [ipaserver.test.local] (item={'suffix': 'domain+ca', 'left': 'ipareplica3.test.local', 'right': 'ipareplica4.test.local'}) => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python"}, "ansible_loop_var": "item", "changed": false, "item": {"left": "ipareplica3.test.local", "right": "ipareplica4.test.local", "suffix": "domain+ca"}, "msg": "topologysegment_add: Server is unwilling to perform: Segment already exists in topology. Add rejected."}

PLAY RECAP **********************************************************************************************************
ipaserver.test.local       : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

==========
On Server
==========
[root@ipaserver ~]# ipa topologysegment-show domain ipareplica3.test.local-to-ipareplica4.test.local
ipa: ERROR: ipareplica3.test.local-to-ipareplica4.test.local: segment not found
 
[root@ipaserver ~]# ipa topologysegment-show ca ipareplica3.test.local-to-ipareplica4.test.local
  Segment name: ipareplica3.test.local-to-ipareplica4.test.local
  Left node: ipareplica3.test.local
  Right node: ipareplica4.test.local
  Connectivity: both


upstream ticket: https://github.com/freeipa/ansible-freeipa/issues/106

Comment 1 Thomas Woerner 2019-07-26 17:43:35 UTC
Here is the upstream fix: https://github.com/freeipa/ansible-freeipa/commit/f786658606fca1a3d8077015b39b09ba7a7559b3

Comment 4 Varun Mylaraiah 2019-08-01 11:30:10 UTC
Verified 
ansible-freeipa-0.1.6-3.el8.noarch

# cat add-topologysegments.yml
---
- name: Add topology segments
  hosts: ipaserver
  become: true
  gather_facts: false

  vars:
    ipatopology_segments:
    - {suffix: domain+ca, left: ipareplica1.test.local, right: ipareplica2.test.local}

  tasks:
  - name: Add topology segment
    ipatopologysegment:
      ipaadmin_password: <xxxxxxxxxx>
      suffix: "{{ item.suffix }}"
      name: "{{ item.name | default(omit) }}"
      left: "{{ item.left }}"
      right: "{{ item.right }}"
      state: present
    loop: "{{ ipatopology_segments | default([]) }}"


# ansible-playbook -vv -i inventory/hosts.topologysegment  add-topologysegments.yml 
ansible-playbook 2.8.3
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.6.8 (default, Jul  3 2019, 10:59:07) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]
No config file found; using defaults

PLAYBOOK: add-topologysegments.yml **********************************************************************************
1 plays in add-topologysegments.yml

PLAY [Add topology segments] ****************************************************************************************
META: ran handlers

TASK [Add topology segment] *****************************************************************************************
task path: /root/add-topologysegments.yml:12
changed: [ipaserver.test.local] => (item={'suffix': 'domain+ca', 'left': 'ipareplica1.test.local', 'right': 'ipareplica2.test.local'}) => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python"}, "ansible_loop_var": "item", "changed": true, "item": {"left": "ipareplica1.test.local", "right": "ipareplica2.test.local", "suffix": "domain+ca"}}
META: ran handlers
META: ran handlers

PLAY RECAP **********************************************************************************************************
ipaserver.test.local       : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0  


==========
On Server
==========
[root@kvm-02-guest22 ~]# ipa topologysegment-show domain ipareplica1.test.local-to-ipareplica2.test.local
  Segment name: ipareplica1.test.local-to-ipareplica2.test.local
  Left node: ipareplica1.test.local
  Right node: ipareplica2.test.local
  Connectivity: both
[root@kvm-02-guest22 ~]# ipa topologysegment-show ca ipareplica1.test.local-to-ipareplica2.test.local
  Segment name: ipareplica1.test.local-to-ipareplica2.test.local
  Left node: ipareplica1.test.local
  Right node: ipareplica2.test.local
  Connectivity: both

Comment 6 errata-xmlrpc 2019-11-05 21:08:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3418


Note You need to log in before you can comment on or make changes to this bug.