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

runcmd module not working #750

Open
mohanrajbma opened this issue Jul 31, 2024 · 0 comments
Open

runcmd module not working #750

mohanrajbma opened this issue Jul 31, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mohanrajbma
Copy link

SUMMARY

Using ovirt_vm module, I am trying to create a new VM in OLVM and run scripts on first boot using runcmd module, VM is created fine but runcmd module not working, it does not run the script.

other cloud-init module such as write_files, users are working fine. I am referring this examples - https://cloudinit.readthedocs.io/en/latest/reference/examples.html

versions-
olvm - 4.5.4-1.0.31.el8
oracle linux template - 8.8
cloud-init -22.1-6.0.2.el8-7.2
Ansible - 2.9.27
ovirt.ovirt collection - 3.2.0

COMPONENT NAME

ovirt_vm.py

STEPS TO REPRODUCE
- name: create VM in OLVM using Ansible
  ovirt.ovirt.ovirt_vm:
    name: "{{ vm_name }}"
    cluster: "{{ OLVM }}"
    state: running
    template: "{{ Template }}"
    operating_system: "{{ olvm_os }}"
    memory: "{{ memoryGb }}GiB"
    cpu_cores: "{{ vcpus }}"
    type: "{{ vmType }}"
    nics: "{{ NetworkList }}"
    cloud_init_persist: true
    wait: true
    cloud_init:
      host_name: "{{ vm_name}}"
      custom_script: |
        runcmd:
          - mkdir /run/mydir
        write_files:
          - content: |
              Hello, world!
            path: /tmp/greeting.txt
            permissions: '0644'
EXPECTED RESULTS

both the directory /run/mydir and file /tmp/greeting.txt gets created.

ACTUAL RESULTS
file /tmp/greeting.txt gets created
 directory /run/mydir does not get created.

@mohanrajbma mohanrajbma added the bug Something isn't working label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant