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

An error occurs in check mode when the agent is not installed #1

Open
sbilque opened this issue Nov 24, 2023 · 0 comments
Open

An error occurs in check mode when the agent is not installed #1

sbilque opened this issue Nov 24, 2023 · 0 comments

Comments

@sbilque
Copy link
Member

sbilque commented Nov 24, 2023

Describe the bug

The following error message occurs when the role is used in check mode :

The Control/M Agent Windows service is not installed. Cannot find any service with service name 'ctmag'.

To Reproduce

Steps to reproduce the behavior:

  1. Create a playbook named test.yml:
- name: Ensure the Control-M/Agent configuration
  hosts: windows
  gather_facts: no

  roles:
    - win_controlm_agent_config

  tasks:
    - name: Set the "job children inside job object" setting
      win_controlm_agent_config:
        job_children_inside_job_object: "no"
  1. Execute the playbook agains a windows host :
ansible-playbook test.yml --limit windows_host --check -v
  1. The playbook stops as follows :
PLAY [Ensure the Control-M/Agent configuration] ************************************************************************************************************************************

TASK [Set the "job children inside job object" setting] ****************************************************************************************************************************
fatal: [windows_host]: FAILED! => {"changed": false, "msg": "The Control/M Agent Windows service is not installed. Cannot find any service with service name 'ctmag'."}

PLAY RECAP *************************************************************************************************************************************************************************
windows_host               : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Expected behavior

The playbook returns the result :

PLAY [Ensure the Control-M/Agent configuration] ************************************************************************************************************************************

TASK [Set the "job children inside job object" setting] ****************************************************************************************************************************
changed: [windows_host] => {"Config": {"add_job_statistics_to_sysout": true, "agent_directory": "", "agent_to_server_port": 7005, "agent_version": "", "allow_comm_init": true, "authorized_controlm_server_hosts": "", "autoedit_inline": true, "cjk_encoding": "", "cm_name": "", "cm_type": "", "communication_trace": false, "ctms_address_mode": "", "daily_log_file_enabled": true, "days_to_retain_log_files": 1, "default_agent_name": "", "default_printer": "", "diagnostic_level": 0, "echo_job_commands_into_sysout": true, "fd_number": "", "fix_number": "", "foreign_language_support": "LATIN-1", "job_children_inside_job_object": true, "job_output_name": "MEMNAME", "limit_log_file_size": 10, "limit_log_version": 10, "listen_to_network_interface": "*ANY", "logical_agent_name": "windows_host", "logon_as_user": false, "logon_domain": "", "measure_usage_day": 7, "persistent_connection": false, "primary_controlm_server_host": "", "run_user_logon_script": false, "server_agent_protocol_version": 12, "server_to_agent_port": 7006, "smtp_port": 25, "smtp_reply_to_mail": "", "smtp_sender_friendly_name": "", "smtp_sender_mail": "control@m", "smtp_server_relay_name": "", "ssl": false, "tcpip_timeout": 60, "timeout_for_agent_utilities": 600, "tracker_event_port": 7035, "tracker_polling_interval": 60, "wrap_parameters_with_double_quotes": 4}, "changed": true}

PLAY RECAP *************************************************************************************************************************************************************************
windows_host               : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant