Skip to content

Commit

Permalink
Superficial migration BWC -> EWC
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Nov 13, 2018
1 parent 561a182 commit ad25be0
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 78 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ Below is the list of variables you can redefine in your playbook to customize st
| `st2web_ssl_certificate` | `null` | String with custom SSL certificate (`.crt`). If not provided, self-signed certificate will be generated.
| `st2web_ssl_certificate_key` | `null` | String with custom SSL certificate secret key (`.key`). If not provided, self-signed certificate will be generated.
| **bwc**
| `bwc_license` | `null` | BWC license key is required for installing BWC enteprise bits via this ansible role.
| `bwc_repo` | `enterprise` | BWC PackageCloud repository to install. [`enterprise`](https://packagecloud.io/StackStorm/enterprise/), [`enterprise-unstable`](https://packagecloud.io/StackStorm/enterprise-unstable/), [`staging-enterprise`](https://packagecloud.io/StackStorm/staging-enteprise/), [`staging-enterprise-unstable`](https://packagecloud.io/StackStorm/staging-enterprise-unstable/)
| `bwc_version` | `latest` | BWC enterprise version to install. `present` to install available package, `latest` to get automatic updates, or pin it to numeric version like `2.2.0`. The version used here should match `st2_version`.
| `bwc_revision` | `1` | BWC enterprise revision to install. Used only with pinned `bwc_version`.
| `bwc_rbac` | [See `bwc_rbac` variable in role defaults](roles/bwc/defaults/main.yml) | BWC RBAC roles and assignments. This is a dictionary with two keys `roles` and `assignments`. `roles` and `assignments` are in turn both arrays. Each element in the array follows the exact YAML schema for [roles](https://bwc-docs.brocade.com/rbac.html#user-permissions) and [assignments](https://bwc-docs.brocade.com/rbac.html#defining-user-role-assignments) defined in BWC documentation.
| `bwc_ldap` | [See `bwc_ldap` variable in role defaults](roles/bwc/defaults/main.yml) | Settings for BWC LDAP authentication backend. `bwc_ldap` is a dictionary and has one item `backend_kwargs`. `backend_kwargs` should be provided as exactly listed in BWC documentation for [LDAP configuration](https://bwc-docs.brocade.com/authentication.html#auth-backends).
| `bwc_license` | `null` | EWC license key is required for installing EWC enteprise bits via this ansible role.
| `bwc_repo` | `enterprise` | EWC PackageCloud repository to install. [`enterprise`](https://packagecloud.io/StackStorm/enterprise/), [`enterprise-unstable`](https://packagecloud.io/StackStorm/enterprise-unstable/), [`staging-enterprise`](https://packagecloud.io/StackStorm/staging-enteprise/), [`staging-enterprise-unstable`](https://packagecloud.io/StackStorm/staging-enterprise-unstable/)
| `bwc_version` | `latest` | EWC enterprise version to install. `present` to install available package, `latest` to get automatic updates, or pin it to numeric version like `2.2.0`. The version used here should match `st2_version`.
| `bwc_revision` | `1` | EWC enterprise revision to install. Used only with pinned `bwc_version`.
| `bwc_rbac` | [See `bwc_rbac` variable in role defaults](roles/bwc/defaults/main.yml) | EWC RBAC roles and assignments. This is a dictionary with two keys `roles` and `assignments`. `roles` and `assignments` are in turn both arrays. Each element in the array follows the exact YAML schema for [roles](https://ewc-docs.extremenetworks.com/rbac.html#user-permissions) and [assignments](https://ewc-docs.extremenetworks.com/rbac.html#defining-user-role-assignments) defined in EWC documentation.
| `bwc_ldap` | [See `bwc_ldap` variable in role defaults](roles/bwc/defaults/main.yml) | Settings for EWC LDAP authentication backend. `bwc_ldap` is a dictionary and has one item `backend_kwargs`. `backend_kwargs` should be provided as exactly listed in EWC documentation for [LDAP configuration](https://ewc-docs.extremenetworks.com/authentication.html#auth-backends).
| **st2chatops**
| `st2chatops_version` | `latest` | st2chatops version to install. `present` to install available package, `latest` to get automatic updates, or pin it to numeric version like `2.2.0`.
| `st2chatops_st2_api_key` | | st2 API key to be updated in st2chatops.env using "st2 apikey create -k" in a task
Expand Down
3 changes: 2 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# roles_path = /etc/ansible/roles/:/etc/ansible/roles/StackStorm.stackstorm/roles/
---
galaxy_info:
description: Install StackStorm (IFTTT for Ops) with all the components like Web UI, ChatOps, BWC and dependant services including RabbitMQ, MongoDB, PostgreSQL, nginx.
description: Install StackStorm (IFTTT for Ops) with all the components like Web UI, ChatOps, EWC and dependant services including RabbitMQ, MongoDB, PostgreSQL, nginx.
author: armab
company: StackStorm
license: Apache 2.0
Expand All @@ -35,6 +35,7 @@ galaxy_info:
- st2mistral
- st2chatops
- bwc
- ewc
- rabbitmq
- mongodb
- postgresql
Expand Down
14 changes: 7 additions & 7 deletions roles/bwc/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
# BWC PackageCloud repository to install: enterprise, enterprise-unstable, staging-enterprise, staging-enterprise-unstable.
# EWC PackageCloud repository to install: enterprise, enterprise-unstable, staging-enterprise, staging-enterprise-unstable.
bwc_repo: "enterprise"
# `present` to install available package, `latest` to get automatic updates, or pin it to numeric version like `2.2.0`.
bwc_version: latest
# used only if 'bwc_version' is numeric
bwc_revision: 1

# BWC license to install BWC enterprise bits
# EWC license to install EWC enterprise bits
bwc_license: null

# Specify roles and assignments for BWC RBAC.
# Specify roles and assignments for EWC RBAC.
# Roles are pushed as YML files to /opt/stackstorm/rbac/roles
# Assignments are pushed as YML files to /opt/stackstorm/rbac/assignments/
# The schema for roles and assignments follow the exact schema definition
# define in https://bwc-docs.brocade.com/rbac.html#defining-roles-and-permission-grants
# and https://bwc-docs.brocade.com/rbac.html#defining-user-role-assignments.
# define in https://ewc-docs.extremenetworks.com/rbac.html#defining-roles-and-permission-grants
# and https://ewc-docs.extremenetworks.com/rbac.html#defining-user-role-assignments.

bwc_rbac_default_roles: []

Expand All @@ -34,8 +34,8 @@ bwc_rbac:


# By specifying a valid configuration for LDAP,
# (See https://bwc-docs.brocade.com/authentication.html#ldap )
# LDAP auth backend is setup for st2 and BWC.
# (See https://ewc-docs.extremenetworks.com/authentication.html#ldap )
# LDAP auth backend is setup for st2 and EWC.
# Note that you just need to provide the backend_kwargs.
bwc_ldap:
backend_kwargs: {}
4 changes: 3 additions & 1 deletion roles/bwc/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
galaxy_info:
description: Install BWC Entperprise components, setup RBAC and LDAP
description: Install EWC Entperprise components, setup RBAC and LDAP
author: lakshmi-kannan
company: StackStorm
license: Apache 2.0
Expand All @@ -18,6 +18,8 @@ galaxy_info:
- stackstorm
- BWC
- Brocade Workflow Composer
- EWC
- Extreme Workflow Composer
- repositories
- packagecloud
dependencies:
Expand Down
12 changes: 6 additions & 6 deletions roles/bwc/tasks/bwc_repos_apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
delay: 3
until: _task is succeeded
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

# This is the exact key as the open source repo but this behavior might change.
- name: Add keys to keyring
Expand All @@ -27,8 +27,8 @@
delay: 3
until: _task is succeeded
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: "Add packagecloud.io repository: StackStorm/{{ bwc_repo }}"
become: yes
Expand All @@ -43,5 +43,5 @@
delay: 3
until: added_bwc_deb_repository is succeeded
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise
4 changes: 2 additions & 2 deletions roles/bwc/tasks/bwc_repos_cleanup_apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
path: /etc/apt/sources.list.d/StackStorm_{{ bwc_repo }}
state: absent
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise
4 changes: 2 additions & 2 deletions roles/bwc/tasks/bwc_repos_cleanup_yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
name: "StackStorm_{{ bwc_repo }}"
state: absent
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise
26 changes: 13 additions & 13 deletions roles/bwc/tasks/bwc_repos_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
group: st2
state: directory
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Handle bwc_license change
include_tasks: license.yml
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Get read token for repo from packagecloud
become: yes
Expand All @@ -36,8 +36,8 @@
delay: 3
until: _task is succeeded
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Read bwc_read_token from file
become: yes
Expand All @@ -46,21 +46,21 @@
command: cat "/etc/packagecloud/StackStorm_{{ bwc_repo }}_read_token.txt"
register: _bwc_read_token
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Set bwc_read_token variable
no_log: yes
set_fact:
bwc_read_token: "{{ _bwc_read_token.stdout }}"
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Add BWC enterprise repos on {{ ansible_facts.distribution }}
- name: Add EWC enterprise repos on {{ ansible_facts.distribution }}
include_tasks: bwc_repos_{{ ansible_facts.pkg_mgr }}.yml
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise
register: bwc_repo_added
when: bwc_read_token != ''
8 changes: 4 additions & 4 deletions roles/bwc/tasks/bwc_repos_yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
delay: 3
until: _task is succeeded
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise
- skip_ansible_lint

- name: "Add packagecloud.io repository: StackStorm/{{ bwc_repo }}"
Expand All @@ -32,5 +32,5 @@
sslverify: yes
register: added_bwc_rpm_repository
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise
34 changes: 17 additions & 17 deletions roles/bwc/tasks/license.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---

- name: Check if BWC license hash file is present
- name: Check if EWC license hash file is present
stat:
path: /etc/packagecloud/bwc_license_hash.txt
register: bwc_license_hash_file
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Read bwc_license_hash_file if it exits
command: cat /etc/packagecloud/bwc_license_hash.txt
Expand All @@ -15,26 +15,26 @@
changed_when: no
when: bwc_license_hash_file.stat.exists
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Set bwc_license_hash from file context
set_fact:
bwc_license_hash: "{{ _bwc_license_hash.stdout }}"
no_log: yes
when: bwc_license_hash_file.stat.exists
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Set bwc_license_hash to incoming hash if not defined
no_log: yes
set_fact:
bwc_license_hash: '{{ bwc_license | hash("sha512") }}'
when: not bwc_license_hash_file.stat.exists
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Write bwc_license_hash to file if file not found on disk
copy:
Expand All @@ -44,8 +44,8 @@
become: yes
when: not bwc_license_hash_file.stat.exists
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: "Cleanup read token cached file from disk"
become: yes
Expand All @@ -54,16 +54,16 @@
state: absent
when: bwc_license | hash("sha512") != bwc_license_hash
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: "Cleanup repo list file from disk"
become: yes
include_tasks: "bwc_repos_cleanup_{{ ansible_facts.pkg_mgr }}.yml"
when: bwc_license | hash("sha512") != bwc_license_hash
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Write new bwc_license_hash to file
copy:
Expand All @@ -74,5 +74,5 @@
no_log: yes
when: bwc_license | hash("sha512") != bwc_license_hash
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise
8 changes: 4 additions & 4 deletions roles/bwc/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
- name: Assert that 'bwc_license' is specified correctly
fail:
msg: "License key must be supplied for BWC enterprise installation."
msg: "License key must be supplied for EWC enterprise installation."
when: bwc_license is not defined or bwc_license is none or bwc_license|length != 48

- name: Add BWC enterprise repos
- name: Add EWC enterprise repos
include_tasks: bwc_repos_setup.yml
tags:
- BWC repos
- StackStorm enterprise
- ewc
- enterprise

- name: Install latest bwc-enterprise package, auto-update
become: yes
Expand Down
4 changes: 3 additions & 1 deletion roles/bwc_smoketests/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
galaxy_info:
description: Test BWC enteprise components were installed correctly.
description: Test EWC enteprise components were installed correctly.
author: lakshmi-kannan
company: StackStorm
license: Apache 2.0
Expand All @@ -18,6 +18,8 @@ galaxy_info:
- stackstorm
- BWC
- Brocade Workflow Composer
- EWC
- Extreme Workflow Composer
- repositories
- packagecloud
dependencies:
Expand Down
Loading

0 comments on commit ad25be0

Please sign in to comment.