diff --git a/ansible/roles/bootstrap/tasks/main.yml b/ansible/roles/bootstrap/tasks/main.yml index 137420d9a..6b8c67e0a 100644 --- a/ansible/roles/bootstrap/tasks/main.yml +++ b/ansible/roles/bootstrap/tasks/main.yml @@ -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: diff --git a/ansible/roles/bootstrap/vars/Debian.yml b/ansible/roles/bootstrap/vars/Debian.yml new file mode 100644 index 000000000..dd037d123 --- /dev/null +++ b/ansible/roles/bootstrap/vars/Debian.yml @@ -0,0 +1,5 @@ +--- +# List of package dependencies to install. +bootstrap_package_dependencies: + - git + - vim diff --git a/ansible/roles/bootstrap/vars/RedHat.yml b/ansible/roles/bootstrap/vars/RedHat.yml new file mode 100644 index 000000000..dd037d123 --- /dev/null +++ b/ansible/roles/bootstrap/vars/RedHat.yml @@ -0,0 +1,5 @@ +--- +# List of package dependencies to install. +bootstrap_package_dependencies: + - git + - vim diff --git a/ansible/roles/ip-allocation/tasks/main.yml b/ansible/roles/ip-allocation/tasks/main.yml index 7fc9ccab7..2707f6005 100644 --- a/ansible/roles/ip-allocation/tasks/main.yml +++ b/ansible/roles/ip-allocation/tasks/main.yml @@ -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 diff --git a/ansible/roles/ip-allocation/vars/Debian.yml b/ansible/roles/ip-allocation/vars/Debian.yml new file mode 100644 index 000000000..00caec722 --- /dev/null +++ b/ansible/roles/ip-allocation/vars/Debian.yml @@ -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 diff --git a/ansible/roles/ip-allocation/vars/RedHat.yml b/ansible/roles/ip-allocation/vars/RedHat.yml new file mode 100644 index 000000000..0c9c9042f --- /dev/null +++ b/ansible/roles/ip-allocation/vars/RedHat.yml @@ -0,0 +1,8 @@ +--- +# Package manager to use. +ip_allocation_package_manager: yum + +# List of packages to install. +ip_allocation_packages: + - python-netaddr + - PyYAML diff --git a/ansible/roles/kolla-ansible/tasks/install.yml b/ansible/roles/kolla-ansible/tasks/install.yml index 9010ce216..6880f76f8 100644 --- a/ansible/roles/kolla-ansible/tasks/install.yml +++ b/ansible/roles/kolla-ansible/tasks/install.yml @@ -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: diff --git a/ansible/roles/kolla-ansible/vars/Debian.yml b/ansible/roles/kolla-ansible/vars/Debian.yml new file mode 100644 index 000000000..9f9aaa972 --- /dev/null +++ b/ansible/roles/kolla-ansible/vars/Debian.yml @@ -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 diff --git a/ansible/roles/kolla-ansible/vars/RedHat.yml b/ansible/roles/kolla-ansible/vars/RedHat.yml new file mode 100644 index 000000000..6b84963e5 --- /dev/null +++ b/ansible/roles/kolla-ansible/vars/RedHat.yml @@ -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 diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 62272d728..2210f637c 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -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 ============