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

az_devops_agent_user_capabilities not works #68

Open
wooch82 opened this issue Sep 8, 2022 · 0 comments
Open

az_devops_agent_user_capabilities not works #68

wooch82 opened this issue Sep 8, 2022 · 0 comments

Comments

@wooch82
Copy link

wooch82 commented Sep 8, 2022

Can't add some capabilities:
vars/Linux.yml:

az_devops_default_agent_folder: "/home/{{ az_devops_agent_user }}/agent/"
az_devops_default_work_folder: "/home/{{ az_devops_agent_user }}/agent/_work"
az_devops_default_agent_package_url: "https://vstsagentpackage.azureedge.net/agent/{{ az_devops_agent_version }}/vsts-agent-linux-x64-{{ az_devops_agent_version }}.tar.gz"
az_devops_default_agent_group: "{{ az_devops_agent_user }}"
az_devops_agent_user_capabilties:
  ansible: "yes"
  azurecli: "yes"
  ny: "yes"

tasks/Linux.yml:

- name: Set provided user defined capabilities
  community.general.ini_file:
    path: "{{ az_devops_agent_folder }}/.env"
    section: null
    option: "{{ item.key }}"
    value: "{{ item.value }}"
    no_extra_spaces: yes
    owner: "{{ az_devops_agent_user }}"
    group: "{{ az_devops_agent_group }}"
  loop: "{{ az_devops_agent_user_capabilities | default({}) | dict2items }}"
  become: true
  register: "user_capabilities"

- debug:
    var: az_devops_agent_user_capabilities

- debug:
    msg: "{{ user_capabilities }}"

Output:

TASK [gsoft.azure_devops_agent : Set provided user defined capabilities] ***********************************************************************************************************************************

TASK [gsoft.azure_devops_agent : debug] ********************************************************************************************************************************************************************
ok: [ny-vsobuild09] => {
    "az_devops_agent_user_capabilities": "VARIABLE IS NOT DEFINED!"
}

TASK [gsoft.azure_devops_agent : debug] ********************************************************************************************************************************************************************
ok: [ny-vsobuild09] => {
    "msg": {
        "changed": false,
        "results": [],
        "skipped": true,
        "skipped_reason": "No items in the list"
    }
}
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

No branches or pull requests

1 participant