blob: bf596de627fdc6f90dfd714d23688460bb6d7567 [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
Zack Williams8625d042016-02-26 14:32:43 -070017---
Zack Williams5223dd92017-02-28 23:38:02 -070018# file: compute-prep/tasks/main.yml
Zack Williams8625d042016-02-26 14:32:43 -070019
Zack Williams709f11b2016-03-17 14:29:51 -070020- name: Install packages
Zack Williamsb2b8c7b2016-03-10 12:47:18 -070021 apt:
Zack Williams6f5a6e72016-08-10 17:45:27 -070022 name: "{{ item }}"
Zack Williams6f5a6e72016-08-10 17:45:27 -070023 update_cache: yes
24 cache_valid_time: 3600
Zack Williams8625d042016-02-26 14:32:43 -070025 with_items:
26 - python-yaml
Zack Williams5223dd92017-02-28 23:38:02 -070027 - python-pip
Zack Williams8625d042016-02-26 14:32:43 -070028
Andy Bavier3a1d0642016-07-01 14:11:39 -040029- name: Add ubuntu user
30 user:
Zack Williams6f5a6e72016-08-10 17:45:27 -070031 name: ubuntu
32 groups: adm
Andy Bavier3a1d0642016-07-01 14:11:39 -040033
Zack Williams5223dd92017-02-28 23:38:02 -070034- name: Add pod public key to user accounts
Zack Williamsfe284a12017-07-01 11:00:04 -070035 when: not use_maas
Zack Williams5223dd92017-02-28 23:38:02 -070036 authorized_key:
37 user: "{{ item }}"
38 key: "{{ lookup('file', '{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub') }}"
39 with_items:
40 - root
41 - ubuntu
42
43- name: Add pod public key to user accounts (MaaS)
Zack Williamsfe284a12017-07-01 11:00:04 -070044 when: use_maas
Zack Williams5223dd92017-02-28 23:38:02 -070045 authorized_key:
46 user: "{{ item }}"
47 key: "{{ lookup('file', '/opt/cord_profile/node_key.pub') }}"
48 with_items:
49 - root
50 - ubuntu
51
52- name: Copy over CA certs from head node (MaaS)
Zack Williamsfe284a12017-07-01 11:00:04 -070053 when: use_maas
Zack Williamsc047c872017-01-11 08:38:15 -070054 synchronize:
55 src: "/usr/local/share/ca-certificates/"
56 dest: "/usr/local/share/ca-certificates/"
57 notify:
Zack Williams5223dd92017-02-28 23:38:02 -070058 - update-ca-certificates
Zack Williams709f11b2016-03-17 14:29:51 -070059
60- name: Create /var/lib/nova dir
61 file:
Zack Williams5223dd92017-02-28 23:38:02 -070062 path: /var/lib/nova
63 state: directory
Andy Bavier30d27c92016-09-15 15:59:17 -040064
Zack Williams5223dd92017-02-28 23:38:02 -070065- name: Remove requests package which causes SSL errors
Andy Bavier30d27c92016-09-15 15:59:17 -040066 pip:
Zack Williams5223dd92017-02-28 23:38:02 -070067 name: "requests"
68 state: absent