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

Unable to create bricks via webui - Ansible Folded Block Scalar with double quote issue - simple fix. #804

Closed
puchalakd opened this issue Jan 22, 2023 · 0 comments · Fixed by #805

Comments

@puchalakd
Copy link

Unable to create bricks via webui.
In the logs I have found:
"Exception:[Errno 2] No such file or directory: b'echo /root/.local/bin:/root/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin ; lvcreate -l 100%FREE --chunksize 256K --poolmetadatasize 16777.0 --zero n --type thin-pool --thinpool vmstore1_lv_pool RHGS_vg_vmstore1'"

/usr/share/ovirt-engine/ansible-runner-service-project/project/roles/gluster-brick-create/tasks/main.yml
contains 2 tasks that will never execute properly because of using double quotes with > (Folded Block Scalar).

Broken tasks are:

  • name: Create a LV thinpool
  • name: Create an xfs filesystem

Simple fix - remove double quotes for command in these tasks - they do not work with > (Folded Block Scalar).

Is:

- name: Create a LV thinpool
  ansible.builtin.command: >
    "lvcreate -l 100%FREE --chunksize {{ lv_chunksize }} --poolmetadatasize {{ pool_metadatasize }} --zero n
    --type thin-pool --thinpool {{ lvname }}_pool {{ vgname }}"

Should be:

- name: Create a LV thinpool
  ansible.builtin.command: >
    lvcreate -l 100%FREE --chunksize {{ lv_chunksize }} --poolmetadatasize {{ pool_metadatasize }} --zero n
    --type thin-pool --thinpool {{ lvname }}_pool {{ vgname }}

Is:

- name: Create an xfs filesystem
  ansible.builtin.command: >
    "mkfs.xfs -f -K -i size=512 -n size=8192 {% if 'raid' in disktype %} -d sw={{ diskcount }},su={{ stripesize }}k
    {% endif %} /dev/{{ vgname }}/{{ lvname }}"

Should be:

- name: Create an xfs filesystem
  ansible.builtin.command: >
   mkfs.xfs -f -K -i size=512 -n size=8192 {% if 'raid' in disktype %} -d sw={{ diskcount }},su={{ stripesize }}k
    {% endif %} /dev/{{ vgname }}/{{ lvname }}

Simple ansible playbook to reproduce the issue with double quotes and folded block scalar:

---
- name: Test
  hosts: localhost
  gather_facts: false
  connection: local

  tasks:
  - name: Folded Block Scalar test without double quotaion marks
    ansible.builtin.command: >
      id
      root

  - name: Folded Block Scalar test without double quotaion marks
    ansible.builtin.command: >
      "id
      root"
...
mwperina added a commit to mwperina/ovirt-engine that referenced this issue Jan 23, 2023
The issue is a regression caused by ansible-list changes in
oVirt#658

Signed-off-by: Martin Perina <mperina@redhat.com>
Fixes: oVirt#804
mwperina added a commit that referenced this issue Jan 24, 2023
The issue is a regression caused by ansible-list changes in
#658

Signed-off-by: Martin Perina <mperina@redhat.com>
Fixes: #804
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

Successfully merging a pull request may close this issue.

1 participant