mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Switch VM provisioning method
Remove Ansible playbook. Add shell script to do provisioning. Modify Vagrantfile accordingly.
This commit is contained in:
parent
d25f50f81f
commit
2733fdfa3e
3 changed files with 52 additions and 49 deletions
6
containerd-runc/Vagrantfile
vendored
6
containerd-runc/Vagrantfile
vendored
|
|
@ -51,10 +51,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
vb.cpus = machine['vcpu']
|
||||
end # srv.vm.provider virtualbox
|
||||
|
||||
# Provision Docker on appropriate VMs
|
||||
if machine['provision'] != nil
|
||||
srv.vm.provision 'ansible', playbook: machine['provision']
|
||||
end # if machine['provision']
|
||||
# Provision the VMs
|
||||
srv.vm.provision 'shell', path: 'provision.sh', privileged: true
|
||||
end # config.vm.define
|
||||
end # machines.each
|
||||
end # Vagrant.configure
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
---
|
||||
- hosts: "all"
|
||||
sudo: "yes"
|
||||
remote_user: "vagrant"
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: "Bootstrap node"
|
||||
raw: "apt-get install -y python python2.7"
|
||||
|
||||
- name: "Download containerd"
|
||||
get_url:
|
||||
url: "https://github.com/docker/containerd/releases/download/0.0.5/containerd"
|
||||
dest: "/usr/local/bin/containerd"
|
||||
mode: "0755"
|
||||
|
||||
- name: "Download containerd-shim"
|
||||
get_url:
|
||||
url: "https://github.com/docker/containerd/releases/download/0.0.5/containerd-shim"
|
||||
dest: "/usr/local/bin/containerd-shim"
|
||||
mode: "0755"
|
||||
|
||||
- name: "Download runc"
|
||||
get_url:
|
||||
url: "https://github.com/docker/containerd/releases/download/0.0.5/runc"
|
||||
dest: "/usr/local/bin/runc"
|
||||
mode: "0755"
|
||||
|
||||
- name: "Download ctr"
|
||||
get_url:
|
||||
url: "https://github.com/docker/containerd/releases/download/0.0.5/ctr"
|
||||
dest: "/usr/local/bin/ctr"
|
||||
mode: "0755"
|
||||
|
||||
- name: "Set properties for downloaded files"
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0755"
|
||||
with_items:
|
||||
- /usr/local/bin/containerd
|
||||
- /usr/local/bin/runc
|
||||
- /usr/local/bin/ctr
|
||||
- /usr/local/bin/containerd-shim
|
||||
50
containerd-runc/provision.sh
Normal file
50
containerd-runc/provision.sh
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Install curl if needed
|
||||
if [[ ! -e /usr/bin/curl ]]; then
|
||||
sudo apt-get -yqq install curl
|
||||
fi
|
||||
|
||||
# Download containerd, if it isn't already present on the system
|
||||
if [[ ! -e /usr/local/bin/containerd ]]; then
|
||||
|
||||
# Download containerd from GitHub
|
||||
curl -kLO https://github.com/docker/containerd/releases/download/0.0.5/containerd
|
||||
|
||||
# Move the downloaded binary to /usr/local/bin
|
||||
sudo mv containerd /usr/local/bin/containerd
|
||||
sudo chmod a+x /usr/local/bin/containerd
|
||||
fi
|
||||
|
||||
# Download containerd-shim, if it isn't already present on the system
|
||||
if [[ ! -e /usr/local/bin/containerd-shim ]]; then
|
||||
|
||||
# Download containerd-shim from GitHub
|
||||
curl -kLO https://github.com/docker/containerd/releases/download/0.0.5/containerd-shim
|
||||
|
||||
# Move the downloaded binary to /usr/local/bin
|
||||
sudo mv containerd-shim /usr/local/bin/containerd-shim
|
||||
sudo chmod a+x /usr/local/bin/containerd-shim
|
||||
fi
|
||||
|
||||
# Download ctr, if it isn't already present on the system
|
||||
if [[ ! -e /usr/local/bin/ctr ]]; then
|
||||
|
||||
# Download ctr from GitHub
|
||||
curl -kLO https://github.com/docker/containerd/releases/download/0.0.5/ctr
|
||||
|
||||
# Move the downloaded binary to /usr/local/bin
|
||||
sudo mv ctr /usr/local/bin/ctr
|
||||
sudo chmod a+x /usr/local/bin/ctr
|
||||
fi
|
||||
|
||||
# Download runc, if it isn't already present on the system
|
||||
if [[ ! -e /usr/local/bin/runc ]]; then
|
||||
|
||||
# Download runc from GitHub
|
||||
curl -kLO https://github.com/docker/containerd/releases/download/0.0.5/runc
|
||||
|
||||
# Move the downloaded binary to /usr/local/bin
|
||||
sudo mv runc /usr/local/bin/runc
|
||||
sudo chmod a+x /usr/local/bin/runc
|
||||
fi
|
||||
Loading…
Reference in a new issue