dokku / ansible-dokku

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

I would like to know an alternative way to execute single command. #110

Closed akhil-naidu closed 3 years ago

akhil-naidu commented 3 years ago

Presently this is how we can delete an app. Even though ansible provides shell and command modules => We cannot use them; because of the inbuild dokku security to re-enter the name of the app,

---
- hosts: nodes
  roles:
    - dokku_bot.ansible_dokku

  tasks:
    - name: Delete that app
      dokku_app:
        app: "{{ appTitle }}"
        state: absent

Just to destroy one app, this procedure takes a lot of time. I would like to know a better way of handling single commands like:

commands like this need some external input from the user.

ltalirz commented 3 years ago

hi @akhil-naidu , how about something like

---
- hosts: nodes
  roles:
    - dokku_bot.ansible_dokku

  tasks:
    - name: Delete that app
      dokku_app:
        app: "{{ appTitle }}"
        state: absent
      tags: delete-app

and ansible-playbook playbook.yml --tags delete-app ?

akhil-naidu commented 3 years ago

Wow! it seems like this might work. I was looking at the documentation of ansible-dokku and forgot about ansible features.

I will give it a try and will update the status of this issue accordingly.

akhil-naidu commented 3 years ago

hi @akhil-naidu , how about something like

---
- hosts: nodes
  roles:
    - dokku_bot.ansible_dokku

  tasks:
    - name: Delete that app
      dokku_app:
        app: "{{ appTitle }}"
        state: absent
      tags: delete-app

and ansible-playbook playbook.yml --tags delete-app ?

With this, now I was able to delete the app in 3 seconds. xD