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

chore: update ansible-do generator playbook to use dzangolab ansible collection #27

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

Anthony-Phothirath
Copy link
Collaborator

Removed requirement.yml
make install now install the dzangolab ansible collection
playbook now use the dzangolab ansible collection

@@ -22,7 +22,7 @@ docker.data-folder:

install:
@printf "\033[0;32m>>> Install ansible roles\033[0m\n"
ansible-galaxy install -r requirements.yml --force
ansible-galaxy collection install dzangolab.ansible --force
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collections can be listed in requirements.txt. See https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#collection-requirements-file. This is ultimately more flexible than hard-coding the collection to install in the makefile. (the makefile is only a convenience tool, it should not contain any logic)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changes has been made.

@@ -8,5 +8,7 @@

- name: Install aws-cli
hosts: awscli
collections:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know where you found this syntax.
I have found instead that the FQN of the role should be used. see https://docs.ansible.com/ansible/latest/collections_guide/collections_using_playbooks.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changes has been made.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried using the module syntax but did not worked

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax you proposed is only usable for module and therefore doesn't work for a role wich we have, it is technically possible to change a role into a module to some degrees but just for syntax preferences it is too much work for what it would benefit.

@opichon opichon merged commit 661ec40 into main Jan 3, 2025
@Anthony-Phothirath Anthony-Phothirath deleted the update-ansible-role branch January 21, 2025 08:29
@Anthony-Phothirath Anthony-Phothirath restored the update-ansible-role branch January 21, 2025 08:30
@Anthony-Phothirath Anthony-Phothirath deleted the update-ansible-role branch January 21, 2025 08:46
Anthony-Phothirath added a commit that referenced this pull request Jan 21, 2025
…collection (#27)

* chore: update ansible-do generator playbook to use dzangolab ansible collection

* chore:  changed the way we use ansible collection using FQCN and a requirements file

* chore: change file name

* chore: source default is already the same

---------

Co-authored-by: Anthony Phothirath <[email protected]>
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 this pull request may close these issues.

3 participants