Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 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 Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 17 | --- |
| 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 Bavier | 7fea345 | 2017-07-19 09:31:02 -0700 | [diff] [blame] | 38 | - "libapache2-mod-fcgid" |
Andy Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 39 | - "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 Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 75 | - "127.0.0.1 xos-tosca" |