Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #61

Merged
merged 10 commits into from
Dec 22, 2016
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.kitchen/
.kitchen.local.yml
*.retry
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

config.vm.provision :ansible do |ansible|
ansible.playbook = "playbooks/requirements.yml"
ansible.playbook = "requirements.yml"
end
config.vm.provision :ansible do |ansible|
ansible.playbook = "playbooks/stackstorm.yml"
ansible.playbook = "stackstorm.yml"
Copy link
Member

@arm4b arm4b Dec 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update README.md instructions with the new path.

end
end
2 changes: 1 addition & 1 deletion playbooks/requirements.yml → requirements.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- hosts: all
connection: local
tasks:
- name: Install galaxy dependencies
command: ansible-galaxy install -r roles/mistral/requirements.yml
delegate_to: 127.0.0.1
run_once: true
2 changes: 1 addition & 1 deletion roles/mistral/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: restart mistral
sudo: true
become: true
service:
name: mistral
state: restarted
2 changes: 1 addition & 1 deletion roles/mistral/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- role: ANXS.postgresql
version: v1.5.0
tags: [db, postgresql]
sudo: yes
become: yes
postgresql_databases:
- name: "{{ mistral_db }}"
postgresql_users:
Expand Down
18 changes: 9 additions & 9 deletions roles/mistral/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---

- name: Install latest st2mistral
sudo: yes
become: yes
apt:
name: st2mistral
state: latest
when: mistral_version == "stable"

- name: Install latest st2mistral
sudo: yes
become: yes
apt:
name: st2mistral={{ mistral_version }}
state: present
when: mistral_version != "stable"

- name: Configure mistral
sudo: yes
become: yes
ini_file:
dest: /etc/mistral/mistral.conf
section: database
Expand All @@ -24,7 +24,7 @@
backup: yes

- name: Deploy database init script
sudo: yes
become: yes
template:
src: init_mistral_db.SQL.j2
dest: /etc/mistral/init_mistral_db.SQL
Expand All @@ -43,35 +43,35 @@
- restart mistral

- name: Make sure "Initiate database" doesn't run twice
sudo: yes
become: yes
file:
path: /etc/mistral/init_mistral_db.SQL.ansible.has.run
state: touch

- name: Setup Mistral DB tables, etc
sudo: yes
become: yes
command: /opt/stackstorm/mistral/bin/mistral-db-manage --config-file /etc/mistral/mistral.conf upgrade head
args:
creates: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run
notify:
- restart mistral

- name: Make sure "Setup Mistral DB tables, etc" does not run again
sudo: yes
become: yes
file:
path: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run
state: touch

- name: Register mistral actions
sudo: yes
become: yes
command: /opt/stackstorm/mistral/bin/mistral-db-manage --config-file /etc/mistral/mistral.conf populate
args:
creates: /etc/mistral/mistral-db-manage.populate.ansible.has.run
notify:
- restart mistral

- name: Make sure "Register mistral actions" does not run again
sudo: yes
become: yes
file:
path: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run
state: touch
2 changes: 1 addition & 1 deletion roles/mongodb/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: restart mongodb
sudo: yes
become: yes
service:
name: mongod
state: restarted
6 changes: 3 additions & 3 deletions roles/mongodb/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
- name: Add mongodb key
sudo: yes
become: yes
apt_key:
keyserver: keyserver.ubuntu.com
id: 42F3E95A2C4F08279C4960ADD68FA50FEA312927
state: present
tags: [databases, mongodb]

- name: Add mongodb repository
sudo: yes
become: yes
apt_repository:
repo: 'deb http://repo.mongodb.org/apt/{{ ansible_distribution|lower }} {{ ansible_distribution_release|lower }}/mongodb-org/3.2 multiverse'
state: present
tags: [databases, mongodb]

- name: Install mongodb
sudo: yes
become: yes
apt:
name: mongodb-org
update_cache: yes
Expand Down
2 changes: 1 addition & 1 deletion roles/rabbitmq/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: restart rabbitmq
sudo: yes
become: yes
service:
name: rabbitmq-server
state: restarted
2 changes: 1 addition & 1 deletion roles/rabbitmq/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install rabbitmq packages
sudo: yes
become: yes
apt:
name: rabbitmq-server
update_cache: yes
Expand Down
4 changes: 2 additions & 2 deletions roles/st2/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- name: restart st2
sudo: true
become: true
command: "{{ item }}"
with_items:
- st2ctl reload --register-all
- st2ctl restart

- name: restart st2api/st2stream
sudo: true
become: true
command: "st2ctl restart-component {{ item }}"
with_items:
- st2api
Expand Down
6 changes: 3 additions & 3 deletions roles/st2/tasks/config_auth.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Install auth pre-reqs
sudo: yes
become: yes
apt:
name: "{{ item }}"
state: present
Expand All @@ -8,7 +8,7 @@
- apache2-utils

- name: Create htpasswd file
sudo: true
become: true
htpasswd:
path: /etc/st2/htpasswd
name: "{{ st2_auth_username }}"
Expand All @@ -17,7 +17,7 @@
- restart st2api/st2stream

- name: Enable autentication
sudo: yes
become: yes
ini_file:
dest: /etc/st2/st2.conf
section: auth
Expand Down
4 changes: 2 additions & 2 deletions roles/st2/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: Install latest st2 package
sudo: yes
become: yes
apt:
name: st2
state: latest
Expand All @@ -10,7 +10,7 @@
- restart st2

- name: Install latest st2 package
sudo: yes
become: yes
apt:
name: st2={{ st2_version }}-{{ st2_revision }}
state: present
Expand Down
12 changes: 6 additions & 6 deletions roles/st2/tasks/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See: http://docs.stackstorm.com/install/config.html#configure-ssh
---
- name: user | Create system user
sudo: yes
become: yes
user:
name: "{{ st2_system_user }}"
home: "/home/{{ st2_system_user }}"
Expand All @@ -15,16 +15,16 @@
- name: user | Authorize key-based access for system user
vars:
ansible_ssh_pipelining: true
sudo: yes
sudo_user: "{{ st2_system_user }}"
become: yes
become_user: "{{ st2_system_user }}"
authorized_key:
user: "{{ st2_system_user }}"
key: "{{ _user.ssh_public_key }}"
state: present
tags: [st2, user]

- name: user | Add system user to sudoers
sudo: yes
become: yes
lineinfile:
create: yes
dest: /etc/sudoers.d/st2
Expand All @@ -37,7 +37,7 @@


- name: Configure system user in /etc/st2/st2.conf
sudo: yes
become: yes
ini_file:
dest: /etc/st2/st2.conf
section: system_user
Expand All @@ -46,7 +46,7 @@
backup: yes

- name: Configure system user ssh key in /etc/st2/st2.conf
sudo: yes
become: yes
ini_file:
dest: /etc/st2/st2.conf
section: system_user
Expand Down
6 changes: 3 additions & 3 deletions roles/st2repos/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# tasks file for st2repos

- name: Install prereqs
sudo: yes
become: yes
apt:
name: "{{ item }}"
state: present
Expand All @@ -12,13 +12,13 @@
- apt-transport-https

- name: Add keys to keyring
sudo: yes
become: yes
apt_key:
url: https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/gpgkey
state: present

- name: Add StackStorm repos
sudo: yes
become: yes
apt_repository:
repo: 'deb https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release|lower }} main'
state: present
Expand Down
2 changes: 1 addition & 1 deletion roles/st2smoketests/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


- name: Make sure packs are reloaded
sudo: yes
become: yes
command: st2ctl reload --register-all
tags:
- smoke-tests
Expand Down
4 changes: 2 additions & 2 deletions roles/st2web/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
# handlers file for st2web
- name: restart st2
sudo: true
become: true
command: st2ctl restart

- name: Restart nginx
sudo: yes
become: yes
service:
name: nginx
state: restarted
Loading