From fa7dca17505100e4b2ec1269ee59e54d434c5e36 Mon Sep 17 00:00:00 2001 From: Mark Mercado Date: Thu, 23 Dec 2021 09:44:04 -0500 Subject: [PATCH 1/7] Install gpg before calling apt_key --- roles/StackStorm.mongodb/tasks/mongodb_debian.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/StackStorm.mongodb/tasks/mongodb_debian.yml b/roles/StackStorm.mongodb/tasks/mongodb_debian.yml index 328ee7ae..620e4542 100644 --- a/roles/StackStorm.mongodb/tasks/mongodb_debian.yml +++ b/roles/StackStorm.mongodb/tasks/mongodb_debian.yml @@ -1,4 +1,11 @@ --- +- name: apt | Install gpg + become: true + ansible.builtin.apt: + state: present + update_cache: true + name: gpg + - name: apt | Add mongodb key become: yes apt_key: From 8409b9efcce33b7f93a9c5470c23bf5b3ef8bef1 Mon Sep 17 00:00:00 2001 From: Mark Mercado Date: Thu, 23 Dec 2021 10:26:20 -0500 Subject: [PATCH 2/7] Fix constructed st2_services (item.1 is a list) --- roles/StackStorm.st2/tasks/version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/StackStorm.st2/tasks/version.yml b/roles/StackStorm.st2/tasks/version.yml index d62315b4..34aee92b 100644 --- a/roles/StackStorm.st2/tasks/version.yml +++ b/roles/StackStorm.st2/tasks/version.yml @@ -9,7 +9,7 @@ # Injecting 'st2_services' var in the middle of play verified to work with 'restart st2' handler as handlers flushed as last step - name: Redefine list of services based on st2 version set_fact: - st2_services: "{{ st2_services }} + {{ item.1 }}" + st2_services: "{{ st2_services + item.1 }}" # dict2items not available until 2.6, so use Jinja's dictsort instead loop: "{{ st2_services_versioned | dictsort }}" when: item.0 is version_compare(st2_version_installed, '<=') From e8152edc0ff7a3b213efe4a6868d8bf09869893a Mon Sep 17 00:00:00 2001 From: Mark Mercado Date: Thu, 23 Dec 2021 21:00:03 -0500 Subject: [PATCH 3/7] Trigger build From 71aadd68ab47e48759a52ab46dfd6adbee8b8138 Mon Sep 17 00:00:00 2001 From: Mark Mercado Date: Sun, 26 Dec 2021 11:11:36 -0500 Subject: [PATCH 4/7] Update roles/StackStorm.mongodb/tasks/mongodb_debian.yml Co-authored-by: Eugen Cusmaunsa --- roles/StackStorm.mongodb/tasks/mongodb_debian.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/StackStorm.mongodb/tasks/mongodb_debian.yml b/roles/StackStorm.mongodb/tasks/mongodb_debian.yml index 620e4542..94b235a2 100644 --- a/roles/StackStorm.mongodb/tasks/mongodb_debian.yml +++ b/roles/StackStorm.mongodb/tasks/mongodb_debian.yml @@ -1,10 +1,16 @@ --- +# gpg is required for apt_key and may be missing in some minimal installations - name: apt | Install gpg - become: true - ansible.builtin.apt: - state: present - update_cache: true + become: yes + apt: name: gpg + state: present + update_cache: yes + cache_valid_time: 3600 + register: _task + retries: 5 + delay: 3 + until: _task is succeeded - name: apt | Add mongodb key become: yes From 6ed60667fccb9ca16ca9b8c57a245182a0ff23da Mon Sep 17 00:00:00 2001 From: Eugen Cusmaunsa Date: Wed, 29 Dec 2021 18:28:31 +0000 Subject: [PATCH 5/7] Fix the forked builds --- .github/workflows/build.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3cd38723..c32424a2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -97,9 +97,10 @@ jobs: bundle install --jobs $(nproc) --retry 3 - name: Test run: | + echo "Run the Smoke Tests" + # Use a dummy test org for forked PRs + true && `base64 --decode <<< ZXhwb3J0IEhVQk9UX1NMQUNLX1RPS0VOPXhveGItMTc2OTM1OTkzNDE0LWltdFNJRktPYXkxVlFFTWtUdVJWYmh0bAo=` bundle exec kitchen test ${{matrix.distro}} --debug ${{ matrix.name }} - env: - HUBOT_SLACK_TOKEN: ${{ secrets.HUBOT_SLACK_TOKEN }} slack-notification: name: Slack notification for failed master builds From f051dbd5179a4202346f775497e4162b176d0268 Mon Sep 17 00:00:00 2001 From: Mark Mercado Date: Sun, 26 Dec 2021 13:52:05 -0500 Subject: [PATCH 6/7] Markdown linting README.md --- README.md | 73 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 415b0f20..168a3a32 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,20 @@ # Ansible-st2 + Ansible playbooks to deploy [StackStorm](https://github.com/stackstorm/st2). -> [StackStorm](http://stackstorm.com/) is event-driven automation platform written in Python. -With over [50+ integrations](https://github.com/StackStorm/st2contrib/tree/master/packs) like GitHub, Docker, Nagios, NewRelic, AWS, Ansible it allows you to wire together your existing infrastructure into complex Workflows with auto-remediation and many more. -Aka IFTTT orchestration for Ops. +> [StackStorm](http://stackstorm.com/) is event-driven automation platform +> written in Python. +> With over [50+ integrations](https://github.com/StackStorm/st2contrib/tree/master/packs) +> like GitHub, Docker, Nagios, NewRelic, AWS, Ansible it allows you to wire +> together your existing infrastructure into complex Workflows with +> auto-remediation and many more. Aka IFTTT orchestration for Ops. [![Build Status](https://github.com/StackStorm/ansible-st2/actions/workflows/build.yaml/badge.svg)](https://github.com/StackStorm/ansible-st2/actions/workflows/build.yaml) [![Repository deb/rpm](https://img.shields.io/badge/Repository-deb/rpm-blue.svg)](https://packagecloud.io/StackStorm/stable/) [![Join our community Slack](https://stackstorm-community.herokuapp.com/badge.svg)](https://stackstorm.com/community-signup) ## Supported platforms + * Ubuntu Bionic (18.04) * Ubuntu Focal (20.04) * RHEL7 / CentOS7 @@ -17,19 +22,28 @@ Aka IFTTT orchestration for Ops. > If you're using the provided Vagrantfile, note that it uses Bionic by default. -> In order to access StackStorm Web UI, please don't forget to ensure that http/https ports are opened in your firewall system. + +[](ignored) + +> In order to access StackStorm Web UI, please don't forget to ensure that +> http/https ports are opened in your firewall system. ## Requirements -At least 2GB of memory and 3.5GB of disk space is required, since StackStorm is shipped with RabbitMQ, Mongo, Redis and nginx. + +At least 2GB of memory and 3.5GB of disk space is required, since StackStorm is +shipped with RabbitMQ, Mongo, Redis and nginx. ## Installation + ```sh # stackstorm ansible-playbook stackstorm.yml ``` ## Variables -Below is the list of variables you can redefine in your playbook to customize st2 deployment: + +Below is the list of variables you can redefine in your playbook to customize +st2 deployment: | Variable | Default | Description | | ------------------------ | ------------- | ------------ | @@ -65,22 +79,29 @@ Below is the list of variables you can redefine in your playbook to customize st | `st2chatops_version` | `latest` | st2chatops version to install. Use `latest` to get automatic updates or pin it to numeric version like `2.2.0`. ## Examples + Install latest `stable` StackStorm with all its components on local machine: + ```sh ansible-playbook stackstorm.yml -i 'localhost,' --connection=local ``` -> Note that keeping `latest` version is useful to update StackStorm by re-running playbook, since it will reinstall st2 if there is new version available. -This is default behavior. If you don't want updates - consider pinning version-revision numbers. +> Note that keeping `latest` version is useful to update StackStorm by +> re-running playbook, since it will reinstall st2 if there is new version available. + +This is default behavior. If you don't want updates - consider pinning +version-revision numbers. Install specific numeric version of st2 with pinned revision number as well: + ```sh ansible-playbook stackstorm.yml --extra-vars='st2_version=2.2.0 st2_revision=8' ``` -## Installing behind a proxy. +## Installing behind a proxy -If you are installing from behind a proxy, you can use environment variables `http_proxy`, `https_proxy`, and `no_proxy` in the playbook. For the +If you are installing from behind a proxy, you can use environment variables +`http_proxy`, `https_proxy`, and `no_proxy` in the playbook. For the st2smoketests, you will need to disable proxy for localhost. ```yaml @@ -91,24 +112,30 @@ st2smoketests, you will need to disable proxy for localhost. ``` ## Developing + There are a few requirements when developing on `ansible-st2`. These are the platforms we must support (must pass end-to-end testing): -- Ubuntu Bionic -- Ubuntu Focal -- CentOS7 -- CentOS8 -- RHEL7 (via AWS) -- RHEL8 (via AWS) -Must also support Ansible Idempotence (Eg. Ansible-playbook re-run should end with the following results: `changed=0.*failed=0`) +* Ubuntu Bionic +* Ubuntu Focal +* CentOS7 +* CentOS8 +* RHEL7 (via AWS) +* RHEL8 (via AWS) + +Must also support Ansible Idempotence (Eg. Ansible-playbook re-run should end +with the following results: `changed=0.*failed=0`) + +For development purposes there is [Vagrantfile](Vagrantfile) available. The +following command will setup ubuntu18 box (`ubuntu/bionic64`) by default: -For development purposes there is [Vagrantfile](Vagrantfile) available. The following command will setup ubuntu18 box (`ubuntu/bionic64`) by default: ```sh vagrant up ``` Other distros: + ```sh vagrant up ubuntu20 vagrant up centos7 @@ -116,7 +143,9 @@ vagrant up centos8 ``` ## Other Installers + You might be interested in other methods to deploy StackStorm engine: + * Configuration Management * [Puppet Module](https://github.com/stackstorm/puppet-st2) @@ -127,8 +156,12 @@ You might be interested in other methods to deploy StackStorm engine: * [RHEL7/CentOS7](https://docs.stackstorm.com/install/rhel7.html) ## Help -If you're in stuck, our community always ready to help, feel free to: + +If you are stuck, our community is always ready to help, feel free to: + * Ask questions in our [public Slack channel](https://stackstorm.com/community-signup) -* [Report bug](https://github.com/StackStorm/ansible-st2/issues), provide [feature request](https://github.com/StackStorm/ansible-st2/pulls) or just give us a ✮ star +* [Report bug](https://github.com/StackStorm/ansible-st2/issues), provide + [feature request](https://github.com/StackStorm/ansible-st2/pulls) or just + give us a ✮ star Your contribution is more than welcome! From 91d26618c827e03120ac16427da5f560c69039a3 Mon Sep 17 00:00:00 2001 From: Mark Mercado Date: Tue, 4 Jan 2022 17:51:05 -0500 Subject: [PATCH 7/7] Restoring long lines --- README.md | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 168a3a32..02137945 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,7 @@ Ansible playbooks to deploy [StackStorm](https://github.com/stackstorm/st2). -> [StackStorm](http://stackstorm.com/) is event-driven automation platform -> written in Python. -> With over [50+ integrations](https://github.com/StackStorm/st2contrib/tree/master/packs) -> like GitHub, Docker, Nagios, NewRelic, AWS, Ansible it allows you to wire -> together your existing infrastructure into complex Workflows with -> auto-remediation and many more. Aka IFTTT orchestration for Ops. +> [StackStorm](http://stackstorm.com/) is event-driven automation platform written in Python. With over [50+ integrations](https://github.com/StackStorm/st2contrib/tree/master/packs) like GitHub, Docker, Nagios, NewRelic, AWS, Ansible it allows you to wire together your existing infrastructure into complex Workflows with auto-remediation and many more. Aka IFTTT orchestration for Ops. [![Build Status](https://github.com/StackStorm/ansible-st2/actions/workflows/build.yaml/badge.svg)](https://github.com/StackStorm/ansible-st2/actions/workflows/build.yaml) [![Repository deb/rpm](https://img.shields.io/badge/Repository-deb/rpm-blue.svg)](https://packagecloud.io/StackStorm/stable/) @@ -22,16 +17,11 @@ Ansible playbooks to deploy [StackStorm](https://github.com/stackstorm/st2). > If you're using the provided Vagrantfile, note that it uses Bionic by default. - -[](ignored) - -> In order to access StackStorm Web UI, please don't forget to ensure that -> http/https ports are opened in your firewall system. +> In order to access StackStorm Web UI, please don't forget to ensure that http/https ports are opened in your firewall system. ## Requirements -At least 2GB of memory and 3.5GB of disk space is required, since StackStorm is -shipped with RabbitMQ, Mongo, Redis and nginx. +At least 2GB of memory and 3.5GB of disk space is required, since StackStorm is shipped with RabbitMQ, Mongo, Redis and nginx. ## Installation @@ -42,8 +32,7 @@ ansible-playbook stackstorm.yml ## Variables -Below is the list of variables you can redefine in your playbook to customize -st2 deployment: +Below is the list of variables you can redefine in your playbook to customize st2 deployment: | Variable | Default | Description | | ------------------------ | ------------- | ------------ | @@ -86,11 +75,9 @@ Install latest `stable` StackStorm with all its components on local machine: ansible-playbook stackstorm.yml -i 'localhost,' --connection=local ``` -> Note that keeping `latest` version is useful to update StackStorm by -> re-running playbook, since it will reinstall st2 if there is new version available. +> Note that keeping `latest` version is useful to update StackStorm by re-running playbook, since it will reinstall st2 if there is new version available. -This is default behavior. If you don't want updates - consider pinning -version-revision numbers. +This is default behavior. If you don't want updates - consider pinning version-revision numbers. Install specific numeric version of st2 with pinned revision number as well: @@ -100,9 +87,7 @@ ansible-playbook stackstorm.yml --extra-vars='st2_version=2.2.0 st2_revision=8' ## Installing behind a proxy -If you are installing from behind a proxy, you can use environment variables -`http_proxy`, `https_proxy`, and `no_proxy` in the playbook. For the -st2smoketests, you will need to disable proxy for localhost. +If you are installing from behind a proxy, you can use environment variables `http_proxy`, `https_proxy`, and `no_proxy` in the playbook. For the st2smoketests, you will need to disable proxy for localhost. ```yaml environment: @@ -124,11 +109,9 @@ These are the platforms we must support (must pass end-to-end testing): * RHEL7 (via AWS) * RHEL8 (via AWS) -Must also support Ansible Idempotence (Eg. Ansible-playbook re-run should end -with the following results: `changed=0.*failed=0`) +Must also support Ansible Idempotence (Eg. Ansible-playbook re-run should end with the following results: `changed=0.*failed=0`) -For development purposes there is [Vagrantfile](Vagrantfile) available. The -following command will setup ubuntu18 box (`ubuntu/bionic64`) by default: +For development purposes there is [Vagrantfile](Vagrantfile) available. The following command will setup ubuntu18 box (`ubuntu/bionic64`) by default: ```sh vagrant up @@ -160,8 +143,6 @@ You might be interested in other methods to deploy StackStorm engine: If you are stuck, our community is always ready to help, feel free to: * Ask questions in our [public Slack channel](https://stackstorm.com/community-signup) -* [Report bug](https://github.com/StackStorm/ansible-st2/issues), provide - [feature request](https://github.com/StackStorm/ansible-st2/pulls) or just - give us a ✮ star +* [Report bug](https://github.com/StackStorm/ansible-st2/issues), provide [feature request](https://github.com/StackStorm/ansible-st2/pulls) or just give us a ✮ star Your contribution is more than welcome!