forked from apache/openwhisk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.yml
30 lines (24 loc) · 1.51 KB
/
setup.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
---
# This playbook prepares ansible configuration
- hosts: localhost
tasks:
- name: gen hosts if 'local' env is used
local_action: template src="{{playbook_dir}}/environments/local/hosts.j2.ini" dest="{{ playbook_dir }}/environments/local/hosts"
when: "'environments/local' in inventory_dir"
- name: find the ip of docker-machine
local_action: shell "docker-machine" "ip" "{{docker_machine_name | default('whisk')}}"
register: result
when: "'environments/docker-machine' in inventory_dir"
- name: get the docker-machine ip
set_fact:
docker_machine_ip: "{{ result.stdout }}"
when: "'environments/docker-machine' in inventory_dir"
- name: gen hosts for docker-machine
local_action: template src="{{playbook_dir}}/environments/docker-machine/hosts.j2.ini" dest="{{ playbook_dir }}/environments/docker-machine/hosts"
when: "'environments/docker-machine' in inventory_dir"
- name: gen untrusted server certificate for host
local_action: shell "{{ playbook_dir }}/roles/nginx/files/genssl.sh" "*.{{ whisk_api_localhost_name | default(whisk_api_host_name) | default(whisk_api_localhost_name_default) }}" "server"
when: nginx.ssl.cert == "openwhisk-server-cert.pem"
- name: gen untrusted client certificate for host
local_action: shell "{{ playbook_dir }}/roles/nginx/files/genssl.sh" "*.{{ whisk_api_localhost_name | default(whisk_api_host_name) | default(whisk_api_localhost_name_default) }}" "client"
when: nginx.ssl.client_ca_cert == "openwhisk-client-ca-cert.pem"