blob: 87882fbb49765a452c2ac0c72e4db04ba4e6a069 [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Andy Bavier7b90cb82017-06-22 10:33:00 -040017---
18# dev-env/tasks/main.yml
19
20- name: Create SSH keypair
21 user:
22 name: "{{ ansible_env.USER }}"
23 generate_ssh_key: yes
24 ssh_key_bits: 2048
25
26- name: Create node_key
27 copy:
28 src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
29 dest: "{{ ansible_env.HOME }}/node_key"
30
31- name: Install Apache
32 become: yes
33 apt:
34 name: "{{ item }}"
35 update_cache: yes
36 with_items:
37 - "apache2"
Andy Bavier7fea3452017-07-19 09:31:02 -070038 - "libapache2-mod-fcgid"
Andy Bavier7b90cb82017-06-22 10:33:00 -040039 - "apache2-mpm-worker"
40
41- name: Configure Apache
42 become: yes
43 apache2_module:
44 name: "{{ item }}"
45 state: present
46 with_items:
47 - "proxy_http"
48 - "headers"
49 - "rewrite"
50 - "proxy_wstunnel"
51
52- name: Copy Apache conf
53 become: yes
54 copy:
55 src: "roles/apache-proxy/files/cord-http.conf"
56 dest: "/etc/apache2/conf-enabled/cord-http.conf"
57
58- name: Reload Apache
59 become: yes
60 service:
61 name: apache2
62 state: reloaded
63
64- name: Add hosts
65 become: yes
66 lineinfile:
67 dest: /etc/hosts
68 line: "{{ item }}"
69 with_items:
70 - "127.0.0.1 xos"
71 - "127.0.0.1 xos-gui"
72 - "127.0.0.1 xos-ws"
73 - "127.0.0.1 xos-chameleon"
74 - "127.0.0.1 xos-core"
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -070075 - "127.0.0.1 xos-tosca"