dokku / ansible-dokku

Ansible modules for installing and configuring Dokku
MIT License
156 stars 44 forks source link

Migrate to ansible collection #149

Open tbho opened 1 year ago

tbho commented 1 year ago

Yoo,

just saw the issue #148. As our company is using this library quite a lot to automate app provisioning, I thought I give it a try. As of now, we just copy the library and module_utils folder into our Ansible project to have the modules available locally. Works but we have to "update" the modules manually which is kinda 💩.

I took the migration guide from the issue description and used the collection with a git import. Right now I have to call the tasks, in roles we created, like this:

- name: 'Create app {{ app.name }}'
  dokku_bot.ansible_dokku.dokku_app:
    app: '{{ app.name }}'

In the issue description, there is only on collection name. Do we need to change the galaxy.yaml for this? I did not debug all module functionalities, just the standard ones. Help would be appreciated much here. 😄

To install Dokku, I migrated the installation process into a role install_dokku, which can be called like this:

- name: Install dokku
  include_role:
    name: dokku_bot.ansible_dokku.install_dokku
  vars:
    dokku_plugins:
      - name: postgres
        url: https://github.com/dokku/dokku-postgres.git
      - name: redis
        url: https://github.com/dokku/dokku-redis.git

PR is far from being finished nor being perfect. But before putting too much effort into it, I would rather hear your opinions.

Greetings, Tobi

ltalirz commented 1 year ago

Do we need to change the galaxy.yaml for this?

Yes, see https://github.com/dokku/ansible-dokku/blob/master/meta/main.yml for inspiration.

Note that the CI runs fail because the README of the repository is autogenerated. It should be straightforward to adapt the autogeneration script to the new folder structure once we've decided on the way forward.

tbho commented 1 year ago

Hey @ltalirz, are the pre-commit hooks necessary? I cannot get them to run. Am I right in assuming this was replaced by Github Actions?

tbho commented 1 year ago

Hey @ltalirz, are the pre-commit hooks necessary? I cannot get them to run. Am I right in assuming this was replaced by Github Actions?

Ok nevermind, just saw that the gitlab dependcy in the pre commit hook moved to GitHub.

ltalirz commented 1 year ago

The issue at the verify stage exists also on master and does not need to be fixed here https://github.com/dokku/ansible-dokku/issues/154

zenspider commented 5 months ago

what's the status of this? Looks like #154 was addressed.

ltalirz commented 5 months ago

See rather lengthy discussion in https://github.com/dokku/ansible-dokku/issues/148 , in particular https://github.com/dokku/ansible-dokku/issues/148#issuecomment-1369832102 and below