Small ansible impruvments
This commit is contained in:
parent
343ea0c339
commit
424bd0a051
6 changed files with 31 additions and 4 deletions
10
contrib/ansible/ansible.cfg
Normal file
10
contrib/ansible/ansible.cfg
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[defaults]
|
||||||
|
allow_world_readable_tmpfiles=True
|
||||||
|
pipelining=True
|
||||||
|
retry_files_enabled = False
|
||||||
|
inventory = inventory
|
||||||
|
roles_path = roles
|
||||||
|
library = library
|
||||||
|
[connection]
|
||||||
|
pipelining=True
|
||||||
|
|
|
@ -9,4 +9,3 @@ k8s_cluster_name: k8s-demo
|
||||||
|
|
||||||
cloud_provider: baremetal
|
cloud_provider: baremetal
|
||||||
ha_enabled: false
|
ha_enabled: false
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Init k8s cluster
|
- name: Init k8s cluster
|
||||||
hosts: '{{ host }}'
|
hosts: 'k8s-demo'
|
||||||
become: yes
|
become: yes
|
||||||
max_fail_percentage: 0
|
max_fail_percentage: 0
|
||||||
roles:
|
roles:
|
||||||
|
|
2
contrib/ansible/inventory/hosts
Normal file
2
contrib/ansible/inventory/hosts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[k8s]
|
||||||
|
k8s-demo ansible_connection=local
|
|
@ -1 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
groot='/opt/coins-demo'
|
||||||
|
|
||||||
|
k8sDemoWA () {
|
||||||
|
echo 'Disabling swap space...'
|
||||||
|
sync && swapoff -a && sed -i '/ swap / s/^/#/' /etc/fstab
|
||||||
|
}
|
||||||
|
ansible () {
|
||||||
|
echo 'Installing K8s...'
|
||||||
|
cd ${groot}/contrib/ansible && \
|
||||||
|
ansible-playbook bootstrap-node.yml && \
|
||||||
|
ansible-playbook init-cluster.yml
|
||||||
|
}
|
||||||
|
k8sDemoWA;
|
||||||
|
ansible;
|
||||||
|
|
|
@ -64,7 +64,8 @@ tasksel tasksel/first multiselect none, ssh-server, standard
|
||||||
# Individual additional packages to install
|
# Individual additional packages to install
|
||||||
d-i pkgsel/include string \
|
d-i pkgsel/include string \
|
||||||
apt-transport-https gnupg2 ca-certificates curl \
|
apt-transport-https gnupg2 ca-certificates curl \
|
||||||
iptables linux-headers-amd64 git ansible wget
|
iptables linux-headers-amd64 git ansible wget \
|
||||||
|
gdebi-core
|
||||||
|
|
||||||
# Whether to upgrade packages after debootstrap.
|
# Whether to upgrade packages after debootstrap.
|
||||||
# Allowed values: none, safe-upgrade, full-upgrade
|
# Allowed values: none, safe-upgrade, full-upgrade
|
||||||
|
@ -83,7 +84,8 @@ d-i debian-installer/exit/poweroff boolean true
|
||||||
#### Advanced options
|
#### Advanced options
|
||||||
### Running custom commands during the installation
|
### Running custom commands during the installation
|
||||||
d-i preseed/late_command string in-target /bin/sh -c " \
|
d-i preseed/late_command string in-target /bin/sh -c " \
|
||||||
echo k8s-demo > /etc/hostname; \
|
echo k8s-demo > /etc/hostname ; \
|
||||||
|
sed -i 's/debian/k8s-demo/' /etc/hosts ; \
|
||||||
update-alternatives --set iptables /usr/sbin/iptables-legacy ; \
|
update-alternatives --set iptables /usr/sbin/iptables-legacy ; \
|
||||||
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy ; \
|
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy ; \
|
||||||
update-alternatives --set arptables /usr/sbin/arptables-legacy ; \
|
update-alternatives --set arptables /usr/sbin/arptables-legacy ; \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue