Skip to content

Commit

Permalink
WIP: Addresses #8
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlesmithjr committed May 3, 2018
1 parent 3929787 commit 5ce6b57
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions inventory/group_vars/all/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ k8s_pod_network_config: "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl

k8s_users:
- user: pi

k8s_version: 1.9.3
2 changes: 1 addition & 1 deletion playbooks/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
# delay: 2
# with_items: "{{ groups['rpi_k8s_slaves'] }}"

- hosts: rpi_k8s_slaves
- hosts: rpi_k8s
any_errors_fatal: true
tasks:
- name: Updating /etc/hosts
Expand Down
1 change: 1 addition & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- src: https://github.com/mrlesmithjr/ansible-glusterfs.git
- src: https://github.com/mrlesmithjr/ansible-isc-dhcp.git
- src: https://github.com/mrlesmithjr/ansible-k8s.git
version: v1.1.0
- src: https://github.com/mrlesmithjr/ansible-ntp.git
- src: https://github.com/mrlesmithjr/ansible-sshd.git
- src: https://github.com/mrlesmithjr/ansible-timezone.git
2 changes: 2 additions & 0 deletions roles/ansible-k8s/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ k8s_token_file: /etc/kubernetes/.k8s_token

k8s_users:
- user: vagrant

k8s_version: 1.10.2
2 changes: 1 addition & 1 deletion roles/ansible-k8s/meta/.galaxy_install_info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{install_date: 'Fri Feb 16 02:20:37 2018', version: ''}
{install_date: 'Thu May 3 12:16:46 2018', version: v1.1.0}
13 changes: 13 additions & 0 deletions roles/ansible-k8s/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
state: present
become: true

- name: debian | Pinning K8s Version
template:
src: etc/apt/preferences.d/k8s.pref.j2
dest: /etc/apt/preferences.d/k8s.pref
become: true
register: _k8s_pinned_version

- name: debian | Updating Apt Cache
apt:
update_cache: true
become: true
when: _k8s_pinned_version['changed']

- name: debian | Installing K8s Packages
apt:
name: "{{ item }}"
Expand Down
11 changes: 11 additions & 0 deletions roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: kubeadm
Pin: version {{ k8s_version }}*
Pin-Priority: 900

Package: kubectl
Pin: version {{ k8s_version }}*
Pin-Priority: 900

Package: kubelet
Pin: version {{ k8s_version }}*
Pin-Priority: 900

0 comments on commit 5ce6b57

Please sign in to comment.