Skip to content

setmqweb isn't allowed to execute as root #120

@Syko80

Description

@Syko80

Describe the bug
Only tested on Linux The command setmqweb properties -k httpHost -v "*" whiich is run in roles/startconsole/tasks/Linux_startconsole.yml is not allowed to execute as root

To Reproduce
Run the installation including the role startconsole on Linux

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
This is the command (run manually but Ansible is the same) failing as root

{1046EF31-4194-4D82-A011-1BF7E13A9D64}

Tell us the platform and version of the machine that ansible is being run on:
Ansible Automation Platform Controller 4.5.12

Tell us the version of ansible being used:
ansible [core 2.18.1]

Tell us the platforms and versions of the machines that the playbook is targetting (Usually supplied in an inventory file):
Linux jcs-mq-001 6.8.0-1017-azure #20 SMP Tue Oct 22 03:43:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Additional context
With permissions I could branch and code the fix....!!?

However this is the update required

roles/setupconsole/tasks/Linux_setupconsole.yml

Current

---
- name: Allow console to be accessed from anywhere
  ansible.builtin.command:
    cmd: setmqweb properties -k httpHost -v "*"
    chdir: /var/mqm/web/installations/Installation1/servers/mqweb
  changed_when: true

- name: Check if Web Console is Running
  ansible.builtin.command:
    cmd: dspmqweb
    chdir: /var/mqm/web/installations/Installation1/servers/mqweb
  ignore_errors: true
  changed_when: false
  register: console_status
  failed_when:
    - console_status.rc != 0
    - "'is not running.' not in console_status.stderr"

- name: Start web console
  ansible.builtin.command:
    cmd: nohup strmqweb
    chdir: /var/mqm/web/installations/Installation1/servers/mqweb
  when: "'is not running.' in console_status.stderr"

Update

---
- name: Allow console to be accessed from anywhere
  ansible.builtin.command:
    cmd: su - mqm 'setmqweb properties -k httpHost -v "*"'
    chdir: /var/mqm/web/installations/Installation1/servers/mqweb
  changed_when: true

- name: Check if Web Console is Running
  ansible.builtin.command:
    cmd: dspmqweb
    chdir: /var/mqm/web/installations/Installation1/servers/mqweb
  ignore_errors: true
  changed_when: false
  register: console_status
  failed_when:
    - console_status.rc != 0
    - "'is not running.' not in console_status.stderr"

- name: Start web console
  ansible.builtin.command:
    cmd: nohup strmqweb
    chdir: /var/mqm/web/installations/Installation1/servers/mqweb
  when: "'is not running.' in console_status.stderr"

```

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions