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

Pack Install #74

Open
arm4b opened this issue Jan 9, 2017 · 6 comments
Open

Pack Install #74

arm4b opened this issue Jan 9, 2017 · 6 comments
Labels

Comments

@arm4b
Copy link
Member

arm4b commented Jan 9, 2017

Implement a convenient ansible-friendly way (as Ansible module) to install st2 packs, as well as provide configurations/settings for them.

Decide:

  • define config settings in yaml plays inline
  • use /opt/stackstorm/configs/<pack>.yaml

https://docs.stackstorm.com/pack_configs.html

Alternative example from puppet-st2: https://github.com/stackstorm/puppet-st2#installing-and-configuring-packs

In short, it should work like similar pip or gem Ansible module, but for installing st2 packs.

@arm4b
Copy link
Member Author

arm4b commented Feb 3, 2017

One of the possible syntaxes for the new interface to install & configure stackstorm packs:

st2_packs:
  # `st2 pack install ansible`
  - name: ansible

  # `st2 pack install https://github.com/emedvedev/chatops_tutorial`
  - name: https://github.com/emedvedev/chatops_tutorial
  
  # full example with all params and config
  - name: aws
    state: present
    version: 1.2.3
    config:
      setup:
        region: "us-west-2"
        aws_access_key_id: ""
        aws_secret_access_key: ""

  # uninstall pack
  - name: consul
    state: absent

   # additional way to use already prepared file which will be
   # transferred to /opt/stackstorm/configs/servicenow.yml
  - name: servicenow
    config: files/configs/servicenow.yml

inspiration from the http://docs.ansible.com/ansible/pip_module.html

This will require us to write custom Ansible module similar to apt, yum, pip which will work with st2client lib.

@mrlesmithjr
Copy link

FWIW, this is the method that I use currently which actually works pretty well for installing/uninstalling packs. I do agree, however, that there should be a better way. I was also recently looking at ways to leverage the JSON/YAML output in different ways.

https://github.com/mrlesmithjr/ansible-stackstorm/blob/master/tasks/packs.yml

@arm4b
Copy link
Member Author

arm4b commented Mar 13, 2017

Hi @mrlesmithjr, thanks for sharing!
Glad to see you here! I remember your StackStorm roles, which are great 👍

BTW we recently reworked our entire pack installation + discovery story and introduced versioning: https://stackstorm.com/2017/01/31/stackstorm-exchange-new-pack-management/ with https://exchange.stackstorm.org/ and many other features.

I tried to play with just simple Ansible functionality to achive described above Ansible syntax, - but yaml logic is definitely not enough. Some of the problems we want to fix in a long term:


And yeah, simple command: st2 pack install pack_name is what we do currently with some workarounds similar to your example to make the command somehow idempotent, but we look forward for a better approach like writing Ansible module on top of st2client which could handle more complex cases, in Ansible-friendly way.

@mrlesmithjr
Copy link

@armab Absolutely. Not that it provided much value but it does help me understand more of where you are trying to take this. And thanks for sharing the additional info above as well. I will be spending some time going through some of the open issues and etc. I will definitely try to contribute where I can and definitely let me know if there is anything else I can possibly help out with.

@arm4b
Copy link
Member Author

arm4b commented Mar 14, 2017

@mrlesmithjr Awesome! 👍
While you're exploring existing roles/functionality, don't hesitate to create an Issue if you found we missed something. Your feedback and contributions are very welcome, especially as a st2 user.
Additionally, as big Ansible practioner, another pair of 👀 in Pull Requests might help to make sure we do the right thing. For example currently: #125 and #126.

@arm4b
Copy link
Member Author

arm4b commented Sep 4, 2019

The initial simplistic implementation (wrapper around st2 pack install) is implemented in #250, thanks to @punkrokk and @guymatz for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants