Automation with Ansible

Primary tabs

DevOps, Ensemble

Trying to modernize tasks I have to do on cache like change global variables on different servers, different namespaces....

Actually, I have a bash script  doing ssh on each server and running bash  script on each server like this

echo "zn \"namespace\"
s ^Var=1
"|csession ensapp

But this is not clean/modular/..... I was thinking about using Ansible - as it is exactly what I need to do all the git pull. But I am not sure how to interact with cache. A shell ansible module - no way as it does not manage state...... Is there a way to interact with cache in a command line other than csession?

Any experience, advice, ansible module to share?

Thank you

  • + 3
  • 0
  • 145
  • 2
  • 1

Answers

I used csession; so not answering your question, but;

# Run pButtons test profile, hs_instance is a variable
- name: Run pButtons test profile
  command:
    'csession {{ hs_instance }} -U %SYS "run^pButtons(\"test\")"'
  tags: pbuttons
 

See:

https://community.intersystems.com/post/provision-caché-application-using-ansible-part-1

 

 

 

Comments

Is there a way to interact with cache in a command line other than csession

Long story short, out of the box install; No (none that I'm aware of anyway).  Going forward I'm sure InterSystems will recommend using ICM (InterSystems Cloud Manager (for IRIS)), however I agree that doesn't help us for existing installations/configuration management.

I've had a few conversations with a handful of IS staff and there's no "great" answer, but I'm willing to help.  Ansible's up-coming Collections (https://docs.ansible.com/ansible/devel/dev_guide/collections_tech_preview.html) will greatly change how vendors interact with and create modules, so I'm curious if there are any IS internal projects in this space happening right before we start anything on the community side.

@David, Yes ICM could help and be very useful if you had provisioned the cluster with it. Please note that it supports both container based and containerless deployments.

I think that in the case of @sylvie greverend we have a tough case as we are missing a generic REST API for some of these operations and then again you get into the issue of who is authorized to run these ops? How do you handle keys and/or certificates? Etc. So it's not an easily solvable issue.

It appears also that the environment is not homogeneous (most probably not a cloud cluster where "things" are typically more "even") and so we have the issue of modularity and want to be dynamic as we approach the different services (IRIS instances).

I'd like to hear more about the use case to get a fuller picture. I understand the frustration. We are looking at innovating in this area. 

For the time being it sounds like you could do with a dictionary/table/XML/JSON of your nodes that would define the operations you want to run on each instance. Based on that and a %Installer XML template (don't be fooled by the class name; it can be used for configuring an instance post-installation) create a different config for each instance. Subsequently, architect a delivery mechanism of the Installer/config (bash, Ansible, etc.) and run it (load the code; run a method).

Doc on %Installer and an example.

The above idea might sound like overkill but with a varied and wide range of instances all with different configuration and needs, there is no other way to be dynamic, modular & efficient IMO.

I hope to see you at Global Summit 2019 for a chat on this type of issues.

We have a session on ICM but also some interesting preliminary news in this area and we'll be talking about Kubernetes too if this is an area of system management that interests you.

TTYL