blob: 6482995cfcfb1c5dfd2cec49d11cc49665b81f08 [file] [log] [blame]
---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# dev-env/tasks/main.yml
- name: Create SSH keypair
user:
name: "{{ ansible_env.USER }}"
generate_ssh_key: yes
ssh_key_bits: 2048
- name: Copy SSH public key as node_key
copy:
src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
dest: "{{ ansible_env.HOME }}/node_key"
- name: Install Apache
become: yes
apt:
name: "{{ item }}"
update_cache: yes
cache_valid_time: 3600
with_items:
- apache2
- apache2-utils
- name: Configure Apache
become: yes
apache2_module:
name: "{{ item }}"
state: present
with_items:
- headers
- proxy
- proxy_http
- proxy_wstunnel
- rewrite
notify: reload apache2
- name: Copy Apache conf
become: yes
copy:
src: "roles/apache-proxy/files/cord-http.conf"
dest: "/etc/apache2/conf-enabled/cord-http.conf"
owner: root
group: root
mode: 0644
notify: reload apache2
- name: Add hosts
become: yes
lineinfile:
dest: /etc/hosts
line: "{{ item }}"
with_items:
- "127.0.0.1 xos"
- "127.0.0.1 xos-gui"
- "127.0.0.1 xos-ws"
- "127.0.0.1 xos-chameleon"
- "127.0.0.1 xos-core"
- "127.0.0.1 xos-tosca"