From 29055dd0cb1dfe8250eefd45ca8d26daa03d2998 Mon Sep 17 00:00:00 2001 From: armab Date: Fri, 14 Apr 2017 15:05:30 +0100 Subject: [PATCH] Rename 'bwc_pkg_repo' -> 'bwc_repo' We don't have 'st2_pkg_repo' anymore with #134, hence replacing 'bwc_pkg_repo' --- .kitchen.yml | 2 +- README.md | 2 +- roles/bwc/defaults/main.yml | 2 +- roles/bwc/tasks/bwc_repos_apt.yml | 8 ++++---- roles/bwc/tasks/bwc_repos_cleanup_apt.yml | 2 +- roles/bwc/tasks/bwc_repos_cleanup_yum.yml | 2 +- roles/bwc/tasks/bwc_repos_setup.yml | 8 ++++---- roles/bwc/tasks/bwc_repos_yum.yml | 12 ++++++------ roles/bwc/tasks/license.yml | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index d89dbe07..afb340dd 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -16,7 +16,7 @@ provisioner: idempotency_test: true extra_vars: st2_pkg_repo: <%= 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'] %> diff --git a/README.md b/README.md index 509a4547..9cbb2a5e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/roles/bwc/defaults/main.yml b/roles/bwc/defaults/main.yml index f196174f..c7a42481 100644 --- a/roles/bwc/defaults/main.yml +++ b/roles/bwc/defaults/main.yml @@ -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 diff --git a/roles/bwc/tasks/bwc_repos_apt.yml b/roles/bwc/tasks/bwc_repos_apt.yml index 7df47f03..9449ae3f 100644 --- a/roles/bwc/tasks/bwc_repos_apt.yml +++ b/roles/bwc/tasks/bwc_repos_apt.yml @@ -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 diff --git a/roles/bwc/tasks/bwc_repos_cleanup_apt.yml b/roles/bwc/tasks/bwc_repos_cleanup_apt.yml index 073d143b..8fde6ae8 100644 --- a/roles/bwc/tasks/bwc_repos_cleanup_apt.yml +++ b/roles/bwc/tasks/bwc_repos_cleanup_apt.yml @@ -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 diff --git a/roles/bwc/tasks/bwc_repos_cleanup_yum.yml b/roles/bwc/tasks/bwc_repos_cleanup_yum.yml index 769c4bf8..9794ef37 100644 --- a/roles/bwc/tasks/bwc_repos_cleanup_yum.yml +++ b/roles/bwc/tasks/bwc_repos_cleanup_yum.yml @@ -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 diff --git a/roles/bwc/tasks/bwc_repos_setup.yml b/roles/bwc/tasks/bwc_repos_setup.yml index eb9c79ad..f2dba108 100644 --- a/roles/bwc/tasks/bwc_repos_setup.yml +++ b/roles/bwc/tasks/bwc_repos_setup.yml @@ -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 @@ -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 diff --git a/roles/bwc/tasks/bwc_repos_yum.yml b/roles/bwc/tasks/bwc_repos_yum.yml index 95e8c920..b4243366 100644 --- a/roles/bwc/tasks/bwc_repos_yum.yml +++ b/roles/bwc/tasks/bwc_repos_yum.yml @@ -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 diff --git a/roles/bwc/tasks/license.yml b/roles/bwc/tasks/license.yml index 171d13dd..6c29b65f 100644 --- a/roles/bwc/tasks/license.yml +++ b/roles/bwc/tasks/license.yml @@ -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 }}"'