User bio
404 bio not found
Member since Jun 29, 2017
Replies:

I just realized the ansible output I put in my original post was incorrect.  I re-ran it just now.  Here is the correct output which is still having the same issue of running successfully, but the change is not seen in the management portal.

Output:

2025-03-20 10:36:00,354 p=3058295 u=cotelmer n=ansible | ok: [lp-itfuat04] => {

    "iris_merge_output": {

        "changed": true,

        "msg": "All items completed",

        "results": [

            {

                "ansible_loop_var": "item",

                "changed": true,

                "cmd": "set timout 15\nspawn bash -c \"iris merge CLINUAT04 /WORK/CLIN/deploy/cpf_merge_files/all_disable_application.mergefile /CLIN/CLINUAT04/iris.cpf\"\nexpect \"Username: \"\nsend \"hsadmin\\n\"\nexpect \"Password: \"\nsend \"Adm4uat14\"\nexpect eof\n",

                "delta": "0:00:10.031555",

                "end": "2025-03-20 10:36:00.200962",

                "failed": false,

                "invocation": {

                    "module_args": {

                        "_raw_params": "set timout 15\nspawn bash -c \"iris merge CLINUAT04 /WORK/CLIN/deploy/cpf_merge_files/all_disable_application.mergefile /CLIN/CLINUAT04/iris.cpf\"\nexpect \"Username: \"\nsend \"hsadmin\\n\"\nexpect \"Password: \"\nsend \"Adm4uat14\"\nexpect eof\n",

                        "_uses_shell": true,

                        "argv": null,

                        "chdir": null,

                        "creates": null,

                        "executable": "/usr/bin/expect",

                        "removes": null,

                        "stdin": null,

                        "stdin_add_newline": true,

                        "strip_empty_ends": true,

                        "warn": true

                    }

                },

                "item": "CLIN",

                "rc": 0,

                "start": "2025-03-20 10:35:50.169407",

                "stderr": "",

                "stderr_lines": [],

                "stdout": "spawn bash -c iris merge CLINUAT04 /WORK/CLIN/deploy/cpf_merge_files/all_disable_application.mergefile /CLIN/CLINUAT04/iris.cpf\r\n\r\nUsername: hsadmin\r\nPassword: *********",

                "stdout_lines": [

                    "spawn bash -c iris merge CLINUAT04 /WORK/CLIN/deploy/cpf_merge_files/all_disable_application.mergefile /CLIN/CLINUAT04/iris.cpf",

                    "",

                    "Username: hsadmin",

                    "Password: *********"

                ]

            }

        ]

    }

}

2025-03-20 10:36:00,355 p=3058295 u=cotelmer n=ansible | META: ran handlers

2025-03-20 10:36:00,355 p=3058295 u=cotelmer n=ansible | META: ran handlers

Task:

 

- name: Run iris merge with ansible expect to disable application

    ansible.builtin.expect:

      command: "iris merge {{ item }}{{ hostvars[inventory_hostname].env }}{{ hostvars[inventory_hostname].failover_member_id }} /WORK/{{ item }}/deploy/cpf_merge_files/all_disable_application.mergefile /{{ item }}/{{ item }}{{ hostvars[inventory_hostname].env }}{{ hostvars[inventory_hostname].failover_member_id }}/iris.cpf"

      responses:

        "Username: ":

          - "hsadmin\n"

        "Password: ":

          - "{{ pwd }}"

      timeout: 1

    with_items:

      - "{{ instance_type }}"

    register: iris_merge_output # Capture the output from the module

    changed_when: iris_merge_output != 0 # <- Uses the return  code to define when the task has changed.

Output:

2025-03-20 10:06:17,297 p=3052743 u=cotelmer n=ansible | ok: [lp-itfqa04] => {

    "iris_merge_output": {

        "changed": true,

        "msg": "All items completed",

        "results": [

            {

                "ansible_loop_var": "item",

                "changed": true,

                "cmd": "iris merge CLINQA04 /WORK/CLIN/deploy/cpf_merge_files/all_disable_application.mergefile /CLIN/CLINQA04/iris.cpf",

                "delta": "0:00:01.212244",

                "end": "2025-03-20 10:06:17.125457",

                "failed": false,

                "invocation": {

                    "module_args": {

                        "chdir": null,

                        "command": "iris merge CLINQA04 /WORK/CLIN/deploy/cpf_merge_files/all_disable_application.mergefile /CLIN/CLINQA04/iris.cpf",

                        "creates": null,

                        "echo": false,

                        "removes": null,

                        "responses": {

                            "Password: ": [

                                "        "  <- Removed for pasting of output.

                            ],

                            "Username: ": [

                                "hsadmin\n"

                            ]

                        },

                        "timeout": 1

                    }

                },

                "item": "CLIN",

                "rc": 0,

                "start": "2025-03-20 10:06:15.913213",

                "stdout": "\r\nUsername: hsadmin\r\nPassword: *********",

                "stdout_lines": [

                    "",

                    "Username: hsadmin",

                    "Password: *********"

                ]

            }

        ]

    }

}

2025-03-20 10:06:17,298 p=3052743 u=cotelmer n=ansible | META: ran handlers

2025-03-20 10:06:17,298 p=3052743 u=cotelmer n=ansible | META: ran handlers

Content of all_disable_application.mergefile:

[Actions]

ModifyApplication:Name=/ui/interop/rule-editor,Enabled=0

In the portal there was no change.

Certifications & Credly badges:
Tom has no Certifications & Credly badges yet.
Global Masters badges:
Tom has no Global Masters badges yet.
Followers:
Tom has no followers yet.
Following:
Tom has not followed anybody yet.