blob: 6482995cfcfb1c5dfd2cec49d11cc49665b81f08 [file] [log] [blame]
Zack Williamsa28bdf42018-03-22 10:50:40 -07001---
Matteo Scandolo3896c472017-08-01 13:31:42 -07002# 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
Andy Bavier7b90cb82017-06-22 10:33:00 -040016# dev-env/tasks/main.yml
17
18- name: Create SSH keypair
19 user:
20 name: "{{ ansible_env.USER }}"
21 generate_ssh_key: yes
22 ssh_key_bits: 2048
23
Zack Williamsa28bdf42018-03-22 10:50:40 -070024- name: Copy SSH public key as node_key
Andy Bavier7b90cb82017-06-22 10:33:00 -040025 copy:
26 src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
27 dest: "{{ ansible_env.HOME }}/node_key"
28
29- name: Install Apache
30 become: yes
31 apt:
32 name: "{{ item }}"
33 update_cache: yes
Zack Williamsa28bdf42018-03-22 10:50:40 -070034 cache_valid_time: 3600
Andy Bavier7b90cb82017-06-22 10:33:00 -040035 with_items:
Zack Williamsa28bdf42018-03-22 10:50:40 -070036 - apache2
37 - apache2-utils
Andy Bavier7b90cb82017-06-22 10:33:00 -040038
39- name: Configure Apache
40 become: yes
41 apache2_module:
42 name: "{{ item }}"
43 state: present
44 with_items:
Zack Williamsa28bdf42018-03-22 10:50:40 -070045 - headers
46 - proxy
47 - proxy_http
48 - proxy_wstunnel
49 - rewrite
50 notify: reload apache2
Andy Bavier7b90cb82017-06-22 10:33:00 -040051
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"
Zack Williamsa28bdf42018-03-22 10:50:40 -070057 owner: root
58 group: root
59 mode: 0644
60 notify: reload apache2
Andy Bavier7b90cb82017-06-22 10:33:00 -040061
62- name: Add hosts
63 become: yes
64 lineinfile:
65 dest: /etc/hosts
66 line: "{{ item }}"
67 with_items:
68 - "127.0.0.1 xos"
69 - "127.0.0.1 xos-gui"
70 - "127.0.0.1 xos-ws"
71 - "127.0.0.1 xos-chameleon"
72 - "127.0.0.1 xos-core"
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -070073 - "127.0.0.1 xos-tosca"
Zack Williamsa28bdf42018-03-22 10:50:40 -070074