mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
Made sense of terraform's cloud-init temmplate example with docker installation
This commit is contained in:
@@ -12,12 +12,17 @@ data "cloudinit_config" "azurerm_linux_virtual_machine" {
|
||||
filename = "base"
|
||||
}
|
||||
|
||||
# part {
|
||||
# content = file("${path.module}/templates/n-th.yaml")
|
||||
# content_type = "text/cloud-config"
|
||||
# merge_type = "dict(recurse_array,no_replace)+list(append)"
|
||||
# filename = "n-th.yaml"
|
||||
# }
|
||||
part {
|
||||
content = templatefile(
|
||||
"${path.module}/templates/docker-ce.yaml.tftpl",
|
||||
{
|
||||
user = "azureuser"
|
||||
}
|
||||
)
|
||||
content_type = "text/cloud-config"
|
||||
merge_type = "dict(recurse_array,no_replace)+list(append)"
|
||||
filename = "docker"
|
||||
}
|
||||
}
|
||||
|
||||
data "cloudinit_config" "oci_core_instance" {
|
||||
@@ -33,13 +38,13 @@ data "cloudinit_config" "oci_core_instance" {
|
||||
|
||||
part {
|
||||
content = templatefile(
|
||||
"${path.module}/templates/boinc-client.oci-core-instance.yaml.tftpl",
|
||||
"${path.module}/templates/docker-ce.yaml.tftpl",
|
||||
{
|
||||
user = "opc"
|
||||
}
|
||||
)
|
||||
content_type = "text/cloud-config"
|
||||
merge_type = "dict(recurse_array,no_replace)+list(append)"
|
||||
filename = "n-th.yaml"
|
||||
filename = "docker"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#cloud-config
|
||||
|
||||
packages:
|
||||
- boinc-client
|
||||
|
||||
# Something about user ${user}
|
||||
@@ -0,0 +1,20 @@
|
||||
#cloud-config
|
||||
|
||||
packages:
|
||||
- docker-ce
|
||||
|
||||
runcmd:
|
||||
|
||||
# Give the user permissions to use Docker without `sudo`ing.
|
||||
# The 'users' module overrode *both* the SSH keys *and* group assignments in
|
||||
# previous tests. (┛◉Д◉)┛彡┻━┻
|
||||
- grep -qE '^docker:' /etc/group && usermod -a -G docker ${user} || true
|
||||
|
||||
yum_repos:
|
||||
docker-ce:
|
||||
name: Docker CE Stable - $basearch
|
||||
enabled: true
|
||||
baseurl: https://download.docker.com/linux/rhel/$releasever/$basearch/stable
|
||||
priority: 1
|
||||
gpgcheck: true
|
||||
gpgkey: https://download.docker.com/linux/rhel/gpg
|
||||
Reference in New Issue
Block a user