blob: bd3053f50bdd1547f8d85e7dd661e04dbc23d5ec [file] [log] [blame]
Zack Williams18b6f022018-01-19 11:46:54 -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
Zack Williams5223dd92017-02-28 23:38:02 -070016# file: compute-prep/tasks/main.yml
Zack Williams8625d042016-02-26 14:32:43 -070017
Zack Williams709f11b2016-03-17 14:29:51 -070018- name: Install packages
Zack Williamsb2b8c7b2016-03-10 12:47:18 -070019 apt:
Zack Williams6f5a6e72016-08-10 17:45:27 -070020 name: "{{ item }}"
Zack Williams6f5a6e72016-08-10 17:45:27 -070021 update_cache: yes
22 cache_valid_time: 3600
Zack Williams8625d042016-02-26 14:32:43 -070023 with_items:
24 - python-yaml
Zack Williams5223dd92017-02-28 23:38:02 -070025 - python-pip
Zack Williams8625d042016-02-26 14:32:43 -070026
Andy Bavier3a1d0642016-07-01 14:11:39 -040027- name: Add ubuntu user
28 user:
Zack Williams6f5a6e72016-08-10 17:45:27 -070029 name: ubuntu
30 groups: adm
Andy Bavier3a1d0642016-07-01 14:11:39 -040031
Zack Williams5223dd92017-02-28 23:38:02 -070032- name: Add pod public key to user accounts
Zack Williamsfe284a12017-07-01 11:00:04 -070033 when: not use_maas
Zack Williams5223dd92017-02-28 23:38:02 -070034 authorized_key:
35 user: "{{ item }}"
36 key: "{{ lookup('file', '{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub') }}"
37 with_items:
38 - root
39 - ubuntu
40
41- name: Add pod public key to user accounts (MaaS)
Zack Williamsfe284a12017-07-01 11:00:04 -070042 when: use_maas
Zack Williams5223dd92017-02-28 23:38:02 -070043 authorized_key:
44 user: "{{ item }}"
45 key: "{{ lookup('file', '/opt/cord_profile/node_key.pub') }}"
46 with_items:
47 - root
48 - ubuntu
49
50- name: Copy over CA certs from head node (MaaS)
Zack Williamsfe284a12017-07-01 11:00:04 -070051 when: use_maas
Zack Williamsc047c872017-01-11 08:38:15 -070052 synchronize:
53 src: "/usr/local/share/ca-certificates/"
54 dest: "/usr/local/share/ca-certificates/"
55 notify:
Zack Williams5223dd92017-02-28 23:38:02 -070056 - update-ca-certificates
Zack Williams709f11b2016-03-17 14:29:51 -070057
58- name: Create /var/lib/nova dir
59 file:
Zack Williams5223dd92017-02-28 23:38:02 -070060 path: /var/lib/nova
61 state: directory
Andy Bavier30d27c92016-09-15 15:59:17 -040062
Zack Williams5223dd92017-02-28 23:38:02 -070063- name: Remove requests package which causes SSL errors
Andy Bavier30d27c92016-09-15 15:59:17 -040064 pip:
Zack Williams5223dd92017-02-28 23:38:02 -070065 name: "requests"
66 state: absent
Zack Williams18b6f022018-01-19 11:46:54 -070067