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

vars at task level break detection of the next task #31

Closed
zerwes opened this issue Jan 8, 2025 · 2 comments
Closed

vars at task level break detection of the next task #31

zerwes opened this issue Jan 8, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@zerwes
Copy link
Owner

zerwes commented Jan 8, 2025

example play:

---

- name: test file 1
  file:
    path: /a/b/c/1

- name: command with vars
  command: echo
  vars:
    ansible_ssh_pipelining: true

- name: test file 2
  file:
    path: /a/b/c/2

- name: test file 3
  file:
    path: /a/b/c/3

the file module name in task test file 2 will not be converted (because not matched as task)

± ./fqcn-fixer.py -f testfile.yml
loading fqcn map from /home/admzerwes/git/ansible-fqcn-converter/fqcn.yml ...
parsing file /home/admzerwes/git/ansible-fqcn-converter/testfile.yml ...*...*....*.
--- a/testfile.yml
+++ b/testfile.yml
@@ -1,11 +1,12 @@
 ---
 
 - name: test file 1
-  file:
+  ansible.builtin.file:
     path: /a/b/c/1
 
 - name: command with vars
-  command: echo
+  # possible ambiguous replacement: command : ansible.builtin.command | community.ciscosmb.command | community.routeros.command
+  ansible.builtin.command: echo
   vars:
     ansible_ssh_pipelining: true
 
@@ -14,5 +15,5 @@
     path: /a/b/c/2
 
 - name: test file 3
-  file:
+  ansible.builtin.file:
     path: /a/b/c/3
@zerwes zerwes added bug Something isn't working enhancement New feature or request labels Jan 8, 2025
@zerwes zerwes self-assigned this Jan 8, 2025
@zerwes zerwes changed the title file -> ansible.builtin.file not converted vars at task level break detection of the next task Jan 8, 2025
@zerwes zerwes removed the enhancement New feature or request label Jan 8, 2025
@zerwes
Copy link
Owner Author

zerwes commented Jan 8, 2025

error will occur only if the vars tag is the last

- name: command with vars
  vars:
    ansible_ssh_pipelining: true
  command: echo

this will convert as expected

@zerwes
Copy link
Owner Author

zerwes commented Jan 8, 2025

closed by pr #32

@zerwes zerwes closed this as completed Jan 8, 2025
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