Skip to content

Commit

Permalink
Merge pull request #135 from StackStorm/rename/bwc_repo
Browse files Browse the repository at this point in the history
Rename 'bwc_pkg_repo' -> 'bwc_repo'
  • Loading branch information
armab authored Apr 15, 2017
2 parents 37ac2f4 + e2a7c02 commit 651c692
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ provisioner:
idempotency_test: true
extra_vars:
st2repo_name: <%= ENV['ST2_REPO'] || 'stable' %>
bwc_pkg_repo: <%= ENV['BWC_REPO'] || 'enterprise' %>
bwc_repo: <%= ENV['BWC_REPO'] || 'enterprise' %>
license_var: <%= ENV['LICENSE'] %>
bwc_license: <%= ENV[ENV['LICENSE']] || ENV['BWC_LICENSE_ENTERPRISE'] %>
hubot_token: <%= ENV['HUBOT_TOKEN'] %>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Below is the list of variables you can redefine in your playbook to customize st
| `st2mistral_db_password` | `StackStorm` | PostgreSQL DB password for Mistral.
| **bwc**
| `bwc_license` | `null` | BWC license key is required for installing BWC enteprise bits via this ansible role.
| `bwc_pkg_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_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. Use latest `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.
Expand Down
2 changes: 1 addition & 1 deletion roles/bwc/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# BWC PackageCloud repository to install: enterprise, enterprise-unstable, staging-enterprise, staging-enterprise-unstable.
bwc_pkg_repo: "enterprise"
bwc_repo: "enterprise"
# 'latest' to get latest version or numeric like '2.1.1'
bwc_version: latest
# used only if 'bwc_version' is numeric
Expand Down
8 changes: 4 additions & 4 deletions roles/bwc/tasks/bwc_repos_apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
become: yes
apt_key:
id: 418A7F2FB0E1E6E7EABF6FE8C2E73424D59097AB
url: https://packagecloud.io/StackStorm/{{ bwc_pkg_repo }}/gpgkey
url: https://packagecloud.io/StackStorm/{{ bwc_repo }}/gpgkey
state: present

- name: "Add packagecloud.io repository: StackStorm/{{ bwc_pkg_repo }}"
- name: "Add packagecloud.io repository: StackStorm/{{ bwc_repo }}"
become: yes
no_log: yes
apt_repository:
filename: "StackStorm_{{ bwc_pkg_repo }}"
repo: 'deb https://{{ bwc_read_token }}:@packagecloud.io/StackStorm/{{ bwc_pkg_repo }}/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release|lower }} main'
filename: "StackStorm_{{ bwc_repo }}"
repo: 'deb https://{{ bwc_read_token }}:@packagecloud.io/StackStorm/{{ bwc_repo }}/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release|lower }} main'
state: present
update_cache: yes
register: added_bwc_deb_repository
2 changes: 1 addition & 1 deletion roles/bwc/tasks/bwc_repos_cleanup_apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
- name: Cleanup repo list file from disk
become: yes
file:
path: /etc/apt/sources.list.d/StackStorm_{{ bwc_pkg_repo }}
path: /etc/apt/sources.list.d/StackStorm_{{ bwc_repo }}
state: absent
2 changes: 1 addition & 1 deletion roles/bwc/tasks/bwc_repos_cleanup_yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
- name: Cleanup repo list file from disk
become: yes
yum_resository:
name: "StackStorm_{{ bwc_pkg_repo }}"
name: "StackStorm_{{ bwc_repo }}"
state: absent
8 changes: 4 additions & 4 deletions roles/bwc/tasks/bwc_repos_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
no_log: yes
changed_when: no
uri:
url: https://{{ bwc_license }}:@packagecloud.io/install/repositories/StackStorm/{{ bwc_pkg_repo }}/tokens.text
# creates: "/etc/packagecloud/StackStorm_{{ bwc_pkg_repo }}_read_token.txt" # Don't download if file already exists
dest: "/etc/packagecloud/StackStorm_{{ bwc_pkg_repo }}_read_token.txt"
url: https://{{ bwc_license }}:@packagecloud.io/install/repositories/StackStorm/{{ bwc_repo }}/tokens.text
# creates: "/etc/packagecloud/StackStorm_{{ bwc_repo }}_read_token.txt" # Don't download if file already exists
dest: "/etc/packagecloud/StackStorm_{{ bwc_repo }}_read_token.txt"
force_basic_auth: yes
method: POST
status_code: 201,200
Expand All @@ -36,7 +36,7 @@
become: yes
no_log: yes
set_fact:
bwc_read_token: "{{ lookup('file', '/etc/packagecloud/StackStorm_{{ bwc_pkg_repo }}_read_token.txt') }}"
bwc_read_token: "{{ lookup('file', '/etc/packagecloud/StackStorm_{{ bwc_repo }}_read_token.txt') }}"

- name: Add BWC enterprise repos on {{ ansible_distribution }}
include: bwc_repos_{{ ansible_pkg_mgr }}.yml
Expand Down
12 changes: 6 additions & 6 deletions roles/bwc/tasks/bwc_repos_yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
state: latest
tags: skip_ansible_lint

- name: "Add packagecloud.io repository: StackStorm/{{ bwc_pkg_repo }}"
- name: "Add packagecloud.io repository: StackStorm/{{ bwc_repo }}"
become: yes
no_log: yes
yum_repository:
name: "StackStorm_{{ bwc_pkg_repo }}"
description: "StackStorm_{{ bwc_pkg_repo }}"
file: "StackStorm_{{ bwc_pkg_repo }}"
baseurl: https://{{ bwc_read_token }}:@packagecloud.io/StackStorm/{{ bwc_pkg_repo }}/el/{{ ansible_distribution_major_version }}/$basearch
name: "StackStorm_{{ bwc_repo }}"
description: "StackStorm_{{ bwc_repo }}"
file: "StackStorm_{{ bwc_repo }}"
baseurl: https://{{ bwc_read_token }}:@packagecloud.io/StackStorm/{{ bwc_repo }}/el/{{ ansible_distribution_major_version }}/$basearch
repo_gpgcheck: yes
gpgkey: "https://{{ bwc_read_token }}:@packagecloud.io/StackStorm/{{ bwc_pkg_repo }}/gpgkey"
gpgkey: "https://{{ bwc_read_token }}:@packagecloud.io/StackStorm/{{ bwc_repo }}/gpgkey"
sslcacert: /etc/pki/tls/certs/ca-bundle.crt
metadata_expire: 300
gpgcheck: no
Expand Down
2 changes: 1 addition & 1 deletion roles/bwc/tasks/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- name: "Cleanup read token cached file from disk"
become: yes
file:
path: "/etc/packagecloud/StackStorm_{{ bwc_pkg_repo }}_read_token.txt"
path: "/etc/packagecloud/StackStorm_{{ bwc_repo }}_read_token.txt"
state: absent
when: '"{{ bwc_license | hash("sha512") }}" != "{{ bwc_license_hash }}"'

Expand Down

0 comments on commit 651c692

Please sign in to comment.