Add support for Ubuntu control hosts

This enables the user to use an Ubuntu machine to manage the cloud. The
remote cloud hosts must still run CentOS.
This commit is contained in:
Mark Goddard 2017-09-07 19:39:45 +01:00
parent 7b50904441
commit c576e4d486
10 changed files with 105 additions and 26 deletions

View File

@ -1,12 +1,12 @@
---
- include_vars: "{{ ansible_os_family }}.yml"
- name: Ensure required packages are installed
yum:
package:
name: "{{ item }}"
state: installed
become: True
with_items:
- git
- vim
with_items: "{{ bootstrap_package_dependencies }}"
- name: Check whether an SSH key exists
stat:

View File

@ -0,0 +1,5 @@
---
# List of package dependencies to install.
bootstrap_package_dependencies:
- git
- vim

View File

@ -0,0 +1,5 @@
---
# List of package dependencies to install.
bootstrap_package_dependencies:
- git
- vim

View File

@ -1,16 +1,29 @@
---
# Note: Currently we install these using Yum to the system packages rather than
# Facts may not be available for the control host, so read the OS release
# manually.
- name: Check the OS release
local_action:
module: shell . /etc/os-release && echo $ID
changed_when: False
register: ip_allocation_os_release
- include_vars: "RedHat.yml"
when: ip_allocation_os_release.stdout in ['centos', 'fedora', 'rhel']
- include_vars: "Debian.yml"
when: ip_allocation_os_release.stdout in ['debian', 'ubuntu']
# Note: Currently we install these using the system package manager rather than
# pip to a virtualenv. This is because Yum is required elsewhere and cannot
# easily be installed in a virtualenv.
- name: Ensure package dependencies are installed
local_action:
module: yum
module: package
name: "{{ item }}"
state: installed
use: "{{ ip_allocation_package_manager }}"
become: True
with_items:
- python-netaddr
- PyYAML
with_items: "{{ ip_allocation_package_dependencies }}"
run_once: True
- name: Ensure IP addresses are allocated

View File

@ -0,0 +1,8 @@
---
# Package manager to use.
ip_allocation_package_manager: apt
# List of packages to install.
ip_allocation_package_dependencies:
- python-netaddr
- python-yaml

View File

@ -0,0 +1,8 @@
---
# Package manager to use.
ip_allocation_package_manager: yum
# List of packages to install.
ip_allocation_packages:
- python-netaddr
- PyYAML

View File

@ -1,23 +1,19 @@
---
- include_vars: "{{ ansible_os_family }}.yml"
- name: Ensure EPEL repo is installed
yum:
name: epel-release
state: installed
become: True
when: ansible_os_family == 'RedHat'
- name: Ensure required packages are installed
yum:
package:
name: "{{ item }}"
state: installed
become: True
with_items:
- gcc
- libffi-devel
- openssl-devel
- patch
- python-devel
- python-pip
- python-virtualenv
with_items: "{{ kolla_ansible_package_dependencies }}"
- name: Ensure source code checkout path exists
file:

View File

@ -0,0 +1,10 @@
---
# List of packages to install.
kolla_ansible_package_dependencies:
- gcc
- libffi-dev
- libssl-dev
- patch
- python-dev
- python-pip
- python-virtualenv

View File

@ -0,0 +1,10 @@
---
# List of packages to install.
kolla_ansible_package_dependencies:
- gcc
- libffi-devel
- openssl-devel
- patch
- python-devel
- python-pip
- python-virtualenv

View File

@ -5,26 +5,50 @@ Installation
Prerequisites
=============
Currently Kayobe supports the following Operating Systems:
Currently Kayobe supports the following Operating Systems on the control host:
- CentOS 7.3
- Ubuntu 16.04
To avoid conflicts with python packages installed by the system package manager
it is recommended to install Kayobe in a virtualenv. Ensure that the
``virtualenv`` python module is available on the control host. For example, on
CentOS::
``virtualenv`` python module is available on the control host.
$ yum install -y python-virtualenv
.. code-block:: console
:caption: CentOS
$ yum install -y python-virtualenv
.. code-block:: console
:caption: Ubuntu
$ apt install -y python-virtualenv
It is necessary to install the GCC compiler chain in order to build the
extensions of some of kayobe's python dependencies. On CentOS::
extensions of some of kayobe's python dependencies.
$ yum install -y gcc
.. code-block:: console
:caption: CentOS
$ yum install -y gcc
.. code-block:: console
:caption: Ubuntu
$ apt install -y gcc
Finally, for cloning and working with the kayobe source code repository, Git is
required. On CentOS::
required.
$ yum install -y git
.. code-block:: console
:caption: CentOS
$ yum install -y git
.. code-block:: console
:caption: Ubuntu
$ apt install -y git
Installation
============