Zack Williams | a28bdf4 | 2018-03-22 10:50:40 -0700 | [diff] [blame] | 1 | --- |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 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 | |
Andy Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 16 | # 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 Williams | a28bdf4 | 2018-03-22 10:50:40 -0700 | [diff] [blame] | 24 | - name: Copy SSH public key as node_key |
Andy Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 25 | 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 Williams | a28bdf4 | 2018-03-22 10:50:40 -0700 | [diff] [blame] | 34 | cache_valid_time: 3600 |
Andy Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 35 | with_items: |
Zack Williams | a28bdf4 | 2018-03-22 10:50:40 -0700 | [diff] [blame] | 36 | - apache2 |
| 37 | - apache2-utils |
Andy Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 38 | |
| 39 | - name: Configure Apache |
| 40 | become: yes |
| 41 | apache2_module: |
| 42 | name: "{{ item }}" |
| 43 | state: present |
| 44 | with_items: |
Zack Williams | a28bdf4 | 2018-03-22 10:50:40 -0700 | [diff] [blame] | 45 | - headers |
| 46 | - proxy |
| 47 | - proxy_http |
| 48 | - proxy_wstunnel |
| 49 | - rewrite |
| 50 | notify: reload apache2 |
Andy Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 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" |
Zack Williams | a28bdf4 | 2018-03-22 10:50:40 -0700 | [diff] [blame] | 57 | owner: root |
| 58 | group: root |
| 59 | mode: 0644 |
| 60 | notify: reload apache2 |
Andy Bavier | 7b90cb8 | 2017-06-22 10:33:00 -0400 | [diff] [blame] | 61 | |
| 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 Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 73 | - "127.0.0.1 xos-tosca" |
Zack Williams | a28bdf4 | 2018-03-22 10:50:40 -0700 | [diff] [blame] | 74 | |