-
Bug
-
Resolution: Duplicate
-
Undefined
-
None
-
Unspecified
-
False
-
-
False
-
-
https://github.com/ansible-collections/vmware.vmware_rest/issues/365
<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete all sections as described, this form is processed automatically -->
-
-
-
-
- SUMMARY
<!--- Explain the problem briefly below -->
Attempting to use module to configure a service that is Stopped and Manual to `state: start` and `startup_type AUTOMATIC`. If both are defined in the same task,, then the state becomes started, but startup_type is not modified and task returns OK on subsequent runs
- SUMMARY
-
-
-
Edit: It also appear that if only State is defined, it will start/stop, but it may not reflect a changed status properly. In a further test, changing `state: stop` resulted in a status of OK when it had been running and was changed to STOPPED in reality. In this case, I had changed the service startup type to MANUAL in the task previous
-
-
-
-
- ISSUE TYPE
-
-
-
- Bug Report
-
-
-
-
- COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
appliance_vmon_service
- COMPONENT NAME
-
-
-
-
-
-
-
- ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible [core 2.13.6]
config file = /runner/ansible.cfg
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
ansible collection location = /runner/collections
executable location = /usr/local/bin/ansible
python version = 3.8.13 (default, Jun 24 2022, 15:27:57) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]
jinja version = 3.1.2
libyaml = True
```
- ANSIBLE VERSION
-
-
-
-
-
-
-
- COLLECTION VERSION
<!--- Paste verbatim output from "ansible-galaxy collection list <namespace>.<collection>" between the quotes
for example: ansible-galaxy collection list community.general
-->
```paste below
Collection Version-
-
-
-
-
-
-
-
-
-
-
-
- -------
vmware.vmware_rest 2.2.0
```
- -------
-
-
-
-
-
-
-
-
-
-
-
-
- COLLECTION VERSION
-
-
-
-
-
-
-
- CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
COLLECTIONS_PATHS(/runner/ansible.cfg) = ['/runner/collections']
DEFAULT_FILTER_PLUGIN_PATH(/runner/ansible.cfg) = ['/runner/custom_filters']
DEFAULT_ROLES_PATH(/runner/ansible.cfg) = ['/runner/roles']
DEFAULT_STRATEGY_PLUGIN_PATH(/runner/ansible.cfg) = ['/runner/custom_plugins/mitogen-0.3.0-rc.0/ansible_mitogen/plugins/strategy']
DEFAULT_TIMEOUT(/runner/ansible.cfg) = 40
HOST_KEY_CHECKING(/runner/ansible.cfg) = False
PARAMIKO_LOOK_FOR_KEYS(/runner/ansible.cfg) = False
```
- CONFIGURATION
-
-
-
-
-
-
-
- OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
Execution Environment built with ansible-builder
vCenter 7.0 U3
- OS / ENVIRONMENT
-
-
-
-
-
-
-
- STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
- STEPS TO REPRODUCE
-
-
-
<!--- Paste example playbooks or commands between quotes below -->
```yaml
- name: NetDumper Service configure automatic startup
vmware.vmware_rest.appliance_vmon_service:
vcenter_hostname: "{{ inventory_hostname }}"
vcenter_username: "{{ vcenter_user }}"
vcenter_password: "{{ vcenter_password }}"
vcenter_validate_certs: "{{ vmware_validate_certs }}"
service: netdumper
startup_type: AUTOMATIC
state: start
delegate_to: localhost
register: result
until: result is not failed
retries: 2
delay: 60
```
<!--- HINT: You can paste gist.github.com links for larger files -->
-
-
-
-
- EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
Service will be both in a Started state and configured for Automatic startup
- EXPECTED RESULTS
-
-
-
-
-
-
-
- ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
Task shows Changed, but using appliance_vmon_service_info we see that only state has changed to STARTED but startup_type is still MANUAL
- ACTUAL RESULTS
-
-
-
Splitting into two separate tasks that modify one parameter at a time results in the desired outcome.
<!--- Paste verbatim command output between quotes -->
```paste below
```