-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbrowbeat_install.yml
31 lines (27 loc) · 1.04 KB
/
browbeat_install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- hosts: localhost
tasks:
- name: detect python version
shell: |
ssh -o 'PreferredAuthentications=publickey' -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile /dev/null' [email protected] /usr/bin/python --version
register: python_version
ignore_errors: true
- name: python interpreter
set_fact:
python_interpreter: "{{ (python_version.stderr_lines|length > 0 and 'Python' in python_version.stderr) | ternary('/usr/bin/python', '/usr/libexec/platform-python') }}"
- name: add undercloud to inventry
add_host:
name: "undercloud"
ansible_host: "172.16.0.2"
ansible_python_interpreter: "{{ python_interpreter }}"
- hosts: undercloud
become: yes
become_user: stack
tasks:
- name: copy the browbeat vars file
copy:
src: browbeat_vars.yml
dest: /home/stack/browbeat/ansible/install/group_vars/all.yml
- name: install browbeat
shell: ansible-playbook -i hosts install/browbeat.yml
args:
chdir: /home/stack/browbeat/ansible