Skip to content

Commit 8b2968d

Browse files
author
alij
committed
Improved placement of Analyst tasks in playbooks
- Updated cloudapex version grep Change-Id: Ie0ec5aa181a53ac37b8d2cc4432ff5f6b735e839 Ticket: none Signed-off-by: alij <alij@plumgrid.com>
1 parent 0d14cb0 commit 8b2968d

4 files changed

Lines changed: 44 additions & 27 deletions

File tree

plumgrid_playbooks/plumgrid_common.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
vars:
4343
pg_service_name: plumgrid-iovisor
4444

45+
- hosts: shared-infra_hosts:compute_hosts:gateway_hosts
46+
user: root
47+
roles:
48+
- plumgrid_utility
49+
4550
- hosts: 127.0.0.1
4651
connection: local
4752
tasks:

plumgrid_playbooks/roles/plumgrid_cloudApex_check/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
- name: Check version of CloudApex
3333
shell: >
34-
cat /var/lib/libvirt/filesystems/plumgrid/opt/pg/web/cloudApex/modules/appCloudApex/appCloudApex.js | grep -i appversion | awk '{print $2}'
34+
/opt/local/bin/nsenter -t $(ps ho pid --ppid $(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/dpkg -l | grep plumgrid-cloudapex | awk '{print $3}' | tr '-' ' ' | awk '{print $1}'
3535
when: ca_stats.stat.exists and (ca_stats.stat.isdir is defined and ca_stats.stat.isdir)
3636
register: ca_ver
3737

plumgrid_playbooks/roles/plumgrid_common/tasks/main.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -124,29 +124,3 @@
124124
src: "00-pg.conf"
125125
dest: "/var/lib/libvirt/filesystems/plumgrid-data/conf/etc/00-pg.conf"
126126
when: middleware_ip is defined
127-
128-
# Stop Analyst service
129-
- name: Stop PLUMgrid Analyst service
130-
shell: >
131-
/opt/local/bin/nsenter -t $(ps ho pid --ppid $(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/service plumgrid-sigmund stop
132-
register: pg_sigmund_check
133-
until: pg_sigmund_check.stdout.find('stop/waiting') != -1
134-
ignore_errors: yes
135-
retries: 3
136-
delay: 5
137-
138-
# Configure Analyst for OPSVM
139-
- name: Configure Analyst
140-
shell: >
141-
/opt/local/bin/nsenter -t $(ps ho pid --ppid $(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/sigmund-configure --ip {{ middleware_ip }} --start --autoboot
142-
ignore_errors: yes
143-
144-
# Ensure Analyst service running
145-
- name: Ensure PLUMgrid Analyst service
146-
shell: >
147-
/opt/local/bin/nsenter -t $(ps ho pid --ppid $(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/service plumgrid-sigmund status
148-
register: pg_sigmund_check
149-
until: pg_sigmund_check.stdout.find('start/running') != -1
150-
ignore_errors: yes
151-
retries: 3
152-
delay: 5
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
#
3+
# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
- name: Stop PLUMgrid Analyst service
18+
shell: >
19+
/opt/local/bin/nsenter -t $(ps ho pid --ppid $(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/service plumgrid-sigmund stop
20+
register: pg_sigmund_check
21+
until: pg_sigmund_check.stdout.find('stop/waiting') != -1
22+
ignore_errors: yes
23+
retries: 3
24+
delay: 5
25+
26+
- name: Configure Analyst
27+
shell: >
28+
/opt/local/bin/nsenter -t $(ps ho pid --ppid $(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/sigmund-configure --ip {{ middleware_ip }} --start --autoboot
29+
ignore_errors: yes
30+
31+
- name: Ensure PLUMgrid Analyst service
32+
shell: >
33+
/opt/local/bin/nsenter -t $(ps ho pid --ppid $(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p /usr/bin/service plumgrid-sigmund status
34+
register: pg_sigmund_check
35+
until: pg_sigmund_check.stdout.find('start/running') != -1
36+
ignore_errors: yes
37+
retries: 3
38+
delay: 5

0 commit comments

Comments
 (0)