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

Extra-variables of type list are ignored and not passed to ansible-playbook #103

Open
ChernikovP opened this issue Jul 18, 2023 · 0 comments

Comments

@ChernikovP
Copy link

ChernikovP commented Jul 18, 2023

Jenkins and plugins versions report

Environment
Jenkins: 2.401.1
OS: Linux - 3.10.0-693.11.6.el7.x86_64
Java: 11.0.3 - Amazon.com Inc. (OpenJDK 64-Bit Server VM)
---
ansible:240.vc26740a_625c0

What Operating System are you using (both controller, and any agents involved in the problem)?

CentOS 7

Reproduction steps

  1. Create debug task that prints extra-var you've submitted
- name: print foobars
  debug:
    var: foobars
  1. Run the script through Jenkins:
ansiblePlaybook(
    playbook: "playbook.yml",
    extraVars: [foobars: ["foo","bar"]]
)

Expected Results

[Pipeline] ansiblePlaybook
[WARN] Omitting extra var foobars: check value is a supported type.
[playbook] $ /app/ansible44/venv/bin/ansible-playbook jenkins/ansible/playbook.yml -i jenkins/ansible/localhost.ini -e ********

PLAY [playbook] **********************************************

TASK [print foobars] ***
ok: [localhost] => {
    "foobars": [
        "foo",
        "bar"
    ]
}

Actual Results

[Pipeline] ansiblePlaybook
[playbook] $ /app/ansible44/venv/bin/ansible-playbook jenkins/ansible/playbook.yml -i jenkins/ansible/localhost.ini 

PLAY [playbook] **********************************************

TASK [print foobars] ***
ok: [localhost] => {
    "foobars": "VARIABLE IS NOT DEFINED!"
}

Anything else?

Apparently #88 broke list-related logic, because with LTS 2.387 this was working.

Proposal: pass extra variables as json to Ansible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants