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

Bootstrap Error #3

Open
ripclawffb opened this issue Jul 25, 2021 · 4 comments
Open

Bootstrap Error #3

ripclawffb opened this issue Jul 25, 2021 · 4 comments

Comments

@ripclawffb
Copy link

I think I might be missing something. I get the following error during the playbook run:

TASK [robertdebock.development_environment.bootstrap : set bootstrap_ansible_user] ********************************************
fatal: [localhost]: FAILED! => changed=false 
  msg: No key/value pairs provided, at least one is required for this action to succeed

I'm running the following version of Ansible:

ansible            4.3.0
ansible-core       2.11.3

I also had to modify the role names in the playbook to get this to run. See below:

  roles:
    - robertdebock.development_environment.bootstrap
    - robertdebock.development_environment.update
    - robertdebock.development_environment.fail2ban
    - robertdebock.development_environment.common
    - robertdebock.development_environment.buildtools
    - robertdebock.development_environment.epel
    - robertdebock.development_environment.python_pip
    - robertdebock.development_environment.docker
    - robertdebock.development_environment.users
    - robertdebock.development_environment.postfix
    - robertdebock.development_environment.vagrant
    - robertdebock.development_environment.investigate
    - robertdebock.development_environment.ansible
    - robertdebock.development_environment.ansible_lint
    - robertdebock.development_environment.molecule
    - robertdebock.development_environment.ara
    - robertdebock.development_environment.ruby
    - robertdebock.development_environment.travis
    - robertdebock.development_environment.git
    - robertdebock.development_environment.atom

I'm running this on a CentOS machine using the Virtualbox Vagrantfile. I had to use the fedora/32-cloud-base vagrant box because fedora/31-cloud-base no longer exists.

I updated all the files listed in the README.md. I didn't have to modify the inventory/hosts file because fedora already existed. I then ran ./playbook.yml from my host machine and got the error above. Ansible was running all the commands against the host machine and not the vagrant machine. Is that what's supposed to happen?

Let me know if you need any other info. Thanks!

@ripclawffb
Copy link
Author

Looks like I needed to update the playbook.yml with the name of the vagrant box I wanted to bootstrap. But if I wanted to bootstrap the localhost, it doesn't work with the error previously stated.

@robertdebock
Copy link
Owner

Hm, I'll have a look later, thanks for the feedback.

@robertdebock
Copy link
Owner

I got the error too somewhere, but forgot where. If I see it again, I'll try to reproduce it. I'm thinking this could be happening under specific conditions, it's not easy to reproduce.

@cjsteel
Copy link

cjsteel commented Feb 14, 2023

I run ansible from a venv but have the same issue when running via apt install ansible. Not sure if this has something to do with the default ansible.cfg (or the lack of one) but when I install via:

ansible-galaxy collection install robertdebock.development_environment

all installed roles are missing the robertdebock. prefix

My quick fix is was to copy the requirements file in the roles directory and edit the name: vars

cat requirements.yml > prefixed_roles_names.yml

and then change the name: entry on each line to include the robertdebock. prefix

  • src: robertdebock.ansible
    name: ansible

becomes:

  • src: robertdebock.ansible
    name: robertdebock.ansible

and then

ansible-galaxy role install -r prefixed_roles_names.yml

from

~/.ansible/collections/ansible_collections/robertdebock/development_environment/roles

directory

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

3 participants