Skip to content

Instantly share code, notes, and snippets.

@g2g
Forked from syntaqx/cloud-init.yaml
Created August 8, 2025 10:53
Show Gist options
  • Save g2g/c0411da48c3c644e016580fbd83301fb to your computer and use it in GitHub Desktop.
Save g2g/c0411da48c3c644e016580fbd83301fb to your computer and use it in GitHub Desktop.

Revisions

  1. @syntaqx syntaqx revised this gist Sep 15, 2022. 2 changed files with 0 additions and 4 deletions.
    2 changes: 0 additions & 2 deletions cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,8 @@
    #cloud-config

    # Option 1 - Full installation using cURL

    package_update: true
    package_upgrade: true
    package_reboot_if_required: true

    groups:
    - docker
    2 changes: 0 additions & 2 deletions simple-cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,8 @@
    #cloud-config

    # Option 2: Simplified, using the default package

    package_update: true
    package_upgrade: true
    package_reboot_if_required: true

    groups:
    - docker
  2. @syntaqx syntaqx renamed this gist Sep 15, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @syntaqx syntaqx revised this gist Sep 15, 2022. 2 changed files with 23 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions cloud-init-simplified.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #cloud-config

    # Option 2: Simplified, using the default package

    package_update: true
    package_upgrade: true
    package_reboot_if_required: true

    groups:
    - docker

    system_info:
    default_user:
    groups: [docker]

    packages:
    - docker.io
    - unattended-upgrades

    final_message: "The system is finally up, after $UPTIME seconds"
    3 changes: 3 additions & 0 deletions cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    #cloud-config

    # Option 1 - Full installation using cURL

    package_update: true
    package_upgrade: true
    package_reboot_if_required: true
  4. @syntaqx syntaqx revised this gist Sep 15, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,7 @@ packages:
    - curl
    - gnupg
    - lsb-release
    - unattended-upgrades

    runcmd:
    - mkdir -p /etc/apt/keyrings
  5. @syntaqx syntaqx revised this gist Sep 15, 2022. No changes.
  6. @syntaqx syntaqx revised this gist Sep 15, 2022. 1 changed file with 9 additions and 14 deletions.
    23 changes: 9 additions & 14 deletions cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -3,12 +3,6 @@ package_update: true
    package_upgrade: true
    package_reboot_if_required: true

    manage-resolv-conf: true
    resolv_conf:
    nameservers:
    - '8.8.8.8'
    - '8.8.4.4'

    groups:
    - docker

    @@ -20,15 +14,16 @@ packages:
    - apt-transport-https
    - ca-certificates
    - curl
    - gnupg-agent
    - software-properties-common
    - gnupg
    - lsb-release

    runcmd:
    - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
    - add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    - apt-get update -y
    - apt-get install -y docker-ce docker-ce-cli containerd.io
    - systemctl start docker
    - mkdir -p /etc/apt/keyrings
    - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
    - apt-get update
    - apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
    - systemctl enable docker
    - systemctl start docker

    final_message: "The system is finally up, after $UPTIME seconds"
    final_message: "The system is finally up, after $UPTIME seconds"
  7. @syntaqx syntaqx revised this gist Sep 15, 2022. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    #cloud-config

    package_update: true
    package_upgrade: true
    package_reboot_if_required: true
    @@ -32,4 +31,4 @@ runcmd:
    - systemctl start docker
    - systemctl enable docker

    final_message: "The system is finally up, after $UPTIME seconds"
    final_message: "The system is finally up, after $UPTIME seconds"
  8. @syntaqx syntaqx revised this gist Sep 15, 2022. 1 changed file with 6 additions and 11 deletions.
    17 changes: 6 additions & 11 deletions cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -10,17 +10,12 @@ resolv_conf:
    - '8.8.8.8'
    - '8.8.4.4'

    users:
    - name: ubuntu
    lock_passwd: true
    shell: /bin/bash
    ssh-authorized-keys:
    - "${ssh_public_key}"
    groups:
    - ubuntu
    - docker
    sudo:
    - ALL=(ALL) NOPASSWD:ALL
    groups:
    - docker

    system_info:
    default_user:
    groups: [ docker ]

    packages:
    - apt-transport-https
  9. @syntaqx syntaqx revised this gist Apr 1, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ packages:

    runcmd:
    - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
    - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    - add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    - apt-get update -y
    - apt-get install -y docker-ce docker-ce-cli containerd.io
    - systemctl start docker
  10. @syntaqx syntaqx revised this gist Apr 1, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ runcmd:
    - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
    - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    - apt-get update -y
    - apt-get install docker-ce docker-ce-cli containerd.io
    - apt-get install -y docker-ce docker-ce-cli containerd.io
    - systemctl start docker
    - systemctl enable docker

  11. @syntaqx syntaqx created this gist Mar 29, 2019.
    40 changes: 40 additions & 0 deletions cloud-init.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    #cloud-config

    package_update: true
    package_upgrade: true
    package_reboot_if_required: true

    manage-resolv-conf: true
    resolv_conf:
    nameservers:
    - '8.8.8.8'
    - '8.8.4.4'

    users:
    - name: ubuntu
    lock_passwd: true
    shell: /bin/bash
    ssh-authorized-keys:
    - "${ssh_public_key}"
    groups:
    - ubuntu
    - docker
    sudo:
    - ALL=(ALL) NOPASSWD:ALL

    packages:
    - apt-transport-https
    - ca-certificates
    - curl
    - gnupg-agent
    - software-properties-common

    runcmd:
    - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
    - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    - apt-get update -y
    - apt-get install docker-ce docker-ce-cli containerd.io
    - systemctl start docker
    - systemctl enable docker

    final_message: "The system is finally up, after $UPTIME seconds"