split role download and preinstall
This commit is contained in:
parent
1695682d85
commit
7006d56ab8
4 changed files with 41 additions and 22 deletions
15
roles/download/defaults/main.yml
Normal file
15
roles/download/defaults/main.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
etcd_version: v2.2.2
|
||||
flannel_version: 0.5.5
|
||||
|
||||
kube_version: v1.1.3
|
||||
kubectl_checksum: "01b9bea18061a27b1cf30e34fd8ab45cfc096c9a9d57d0ed21072abb40dd3d1d"
|
||||
kubelet_checksum: "62191c66f2d670dd52ddf1d88ef81048977abf1ffaa95ee6333299447eb6a482"
|
||||
kube_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/amd64"
|
||||
|
||||
calico_version: v0.13.0
|
||||
calico_plugin_version: v0.7.0
|
||||
|
||||
flannel_download_url: "https://github.com/coreos/flannel/releases/download"
|
||||
calico_download_url: "https://github.com/Metaswitch/calico-docker/releases/download"
|
||||
calico_plugin_download_url: "https://github.com/projectcalico/calico-kubernetes/releases/download/{{calico_plugin_version}}/calico_kubernetes"
|
|
@ -1,23 +1,15 @@
|
|||
---
|
||||
etcd_version: v2.2.2
|
||||
flannel_version: 0.5.5
|
||||
|
||||
kube_version: v1.1.3
|
||||
kubectl_checksum: "01b9bea18061a27b1cf30e34fd8ab45cfc096c9a9d57d0ed21072abb40dd3d1d"
|
||||
kubelet_checksum: "62191c66f2d670dd52ddf1d88ef81048977abf1ffaa95ee6333299447eb6a482"
|
||||
kube_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/amd64"
|
||||
|
||||
calico_version: v0.13.0
|
||||
calico_plugin_version: v0.7.0
|
||||
|
||||
flannel_download_url: "https://github.com/coreos/flannel/releases/download"
|
||||
calico_download_url: "https://github.com/Metaswitch/calico-docker/releases/download"
|
||||
calico_plugin_download_url: "https://github.com/projectcalico/calico-kubernetes/releases/download/{{calico_plugin_version}}/calico_kubernetes"
|
||||
|
||||
req_debian_pkg:
|
||||
common_required_pkgs:
|
||||
- python-httplib2
|
||||
- openssl
|
||||
- curl
|
||||
|
||||
debian_required_pkgs:
|
||||
- python-apt
|
||||
- python-pip
|
||||
|
||||
rh_required_pkgs:
|
||||
- libselinux-python
|
||||
|
||||
pypy_version: 2.4.0
|
||||
python_pypy_url: "https://bitbucket.org/pypy/pypy/downloads/pypy-{{ pypy_version }}.tar.bz2"
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
---
|
||||
- include: download.yml
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['downloader'][0] }}"
|
||||
|
||||
- name: "Identify init system"
|
||||
shell: >
|
||||
if $(pgrep systemd > /dev/null); then
|
||||
echo systemd;
|
||||
else echo sysvinit;
|
||||
else
|
||||
echo sysvinit;
|
||||
fi
|
||||
always_run: True
|
||||
register: init_system_output
|
||||
|
@ -15,12 +12,27 @@
|
|||
- set_fact:
|
||||
init_system: "{{ init_system_output.stdout }}"
|
||||
|
||||
- name: Install packages requirements
|
||||
action:
|
||||
module: "{{ ansible_pkg_mgr }}"
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
with_items: common_required_pkgs
|
||||
|
||||
- name: Install debian packages requirements
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
when: ansible_os_family == "Debian"
|
||||
with_items: req_debian_pkg
|
||||
with_items: debian_required_pkgs
|
||||
|
||||
- name: Install redhat packages requirements
|
||||
action:
|
||||
module: "{{ ansible_pkg_mgr }}"
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
when: ansible_os_family == "RedHat"
|
||||
with_items: rh_required_pkgs
|
||||
|
||||
- include: python-bootstrap.yml
|
||||
when: ansible_os_family not in [ "Debian", "RedHat" ]
|
||||
|
|
Loading…
Reference in a new issue