2 # Copyright 2015, Rackspace US, Inc.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 # Before we do anything, check the minimum requirements
17 - include: check-requirements.yml
21 # We will look for the most specific variable files first and eventually
22 # end up with the least-specific files.
23 - name: Gather variables for each operating system
24 include_vars: "{{ item }}"
26 - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
27 - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
28 - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
29 - "{{ ansible_distribution | lower }}.yml"
30 - "{{ ansible_os_family | lower }}.yml"
34 - name: Create the required directories
38 mode: u=rwx,g=rwx,o=rwx
45 - include: create_sudo_user.yml
49 - include: install_packages.yml
53 # Prepare the data disk, if one is provided
54 - include: prepare_data_disk.yml
55 when: bootstrap_host_data_disk_device != None
59 # Prepare the swap space loopback disk
60 # This is only necessary if there isn't swap already
61 - include: prepare_loopback_swap.yml
63 - ansible_swaptotal_mb < 1
65 - prepare-loopback-swap
67 # Prepare the Cinder LVM VG loopback disk
68 # This is only necessary if bootstrap_host_loopback_cinder is set to yes
69 - include: prepare_loopback_cinder.yml
71 - bootstrap_host_loopback_cinder | bool
73 - prepare-loopback-cinder
75 # Prepare the Nova instance storage loopback disk
76 - include: prepare_loopback_nova.yml
78 - bootstrap_host_loopback_nova | bool
80 - prepare-loopback-nova
82 # Prepare the Swift data storage loopback disks
83 - include: prepare_loopback_swift.yml
85 - bootstrap_host_loopback_swift | bool
87 - prepare-loopback-swift
89 # Prepare the Ceph cluster UUID and loopback disks
90 - include: prepare_ceph.yml
92 - bootstrap_host_ceph | bool
96 # Prepare the network interfaces
97 - include: prepare_networking.yml
101 # Prepare the network interfaces using os-net-config
102 - include: prepare_os_net_config.yml
104 - prepare-os-net-config
106 # Ensure that there are both private and public ssh keys for root
107 - include: prepare_ssh_keys.yml
111 # Put the OpenStack-Ansible configuration for an All-In-One on the host
112 - include: prepare_aio_config.yml
113 when: bootstrap_host_aio_config | bool
117 # Change owner for /etc/openstack_deploy
118 - name: Set permissions for /etc/openstack_deploy
120 path: "/etc/openstack_deploy"
121 owner: "{{ sudo_user }}"
122 group: "{{ sudo_user }}"
126 - name: 2nd phase, set different permissions only for /etc/openstack_deploy -directory
128 path: "/etc/openstack_deploy"
129 owner: "{{ sudo_user }}"
130 group: "{{ sudo_user }}"
132 mode: u=rwX,g=rX,o=rX
134 # Change owner of /etc/userconfig
135 - name: Set permissions for /etc/userconfig
137 path: "/etc/userconfig"
138 owner: "{{ sudo_user }}"
139 group: "{{ sudo_user }}"