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

Group az_devops_agent does not exist error on Ubuntu 20.04 #59

Open
alxm8 opened this issue Mar 18, 2022 · 1 comment · May be fixed by #62
Open

Group az_devops_agent does not exist error on Ubuntu 20.04 #59

alxm8 opened this issue Mar 18, 2022 · 1 comment · May be fixed by #62

Comments

@alxm8
Copy link

alxm8 commented Mar 18, 2022

Trying to get this working using ubuntu 20.04 vm:

error in ansible is: fatal: [localhost]: FAILED! => {"changed": false, "msg": "Group az_devops_agent does not exist"}

vagrant file below:

vagrant file

Vagrant.configure("2") do |config|
    config.vm.box = "generic/ubuntu2004"
    config.vm.provider "hyper-v"
    config.vm.provision "shell",
      inline: "echo installing apps..."
    config.vm.provision :shell, path: "./ansible.sh"
    config.vm.provider "hyperv" do |h, override|
      # Display the VirtualBox GUI when booting the machine
      h.cpus = 2
      h.maxmemory = 2048  
      # Customize the amount of memory on the VM:
      h.memory = 2048
    end
end

./ansible.sh file stored in same folder as vagrantfile

#!/bin/bash -eux

# Install Ansible repository.
sudo apt -y update && apt-get -y upgrade
sudo apt -y install software-properties-common
sudo apt-add-repository ppa:ansible/ansible

# Install Ansible.
sudo apt -y update
sudo apt -y install ansible`

shell commands used to replicate the issue... using local ansible exec

#download the ansible role
ansible-galaxy install gsoft.azure_devops_agent
#make directories
mkdir ~/ansible/
mkdir ~/ansible/azure_devops_agent_play
#create play file
touch ~/ansible/azure_devops_agent_play/main.yml
#add playbook content to file
tee -a ~/ansible/azure_devops_agent_play/main.yml <<EOF
---
- name: "Install devops agent"
  hosts: localhost
  become: yes
  become_user: root
  roles:
    - gsoft.azure_devops_agent
  vars:
    - az_devops_agent_role: build
    - az_devops_accountname: "orgname"
    - az_devops_accesstoken: "xxxxxxxxxxxxxxx"

EOF
ansible-playbook main.yml

error message

<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/vagrant/.ansible/tmp/ansible-tmp-1647628396.287585-29548-243434691462664/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": "Azure DevOps Agent",
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": "az_devops_agent",
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "az_devops_agent",
            "non_unique": false,
            "password": null,
            "password_expire_max": null,
            "password_expire_min": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": "/bin/bash",
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on ubuntu2004.localdomain",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "msg": "Group az_devops_agent does not exist"
}
TASK [gsoft.azure_devops_agent : Add an agent user] ***********************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Group az_devops_agent does not exist"}

help is appreciated!

@danielkubat
Copy link
Contributor

this happened since #56

just define az_devops_agent_group as variable with already existing group.

bitlord added a commit to bitlord/ansible-role-azure-devops-agent that referenced this issue Apr 26, 2022
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.

2 participants