Skip to content

Instantly share code, notes, and snippets.

@marcaurele
Last active August 5, 2022 06:35
Show Gist options
  • Save marcaurele/81cb4e937cbc3ac43fbab16327f3b1fd to your computer and use it in GitHub Desktop.
Save marcaurele/81cb4e937cbc3ac43fbab16327f3b1fd to your computer and use it in GitHub Desktop.
Cloud-init configurations (#cloud-config)

Cloud-Init configurations for Exoscale

Automatic EIP

Having an EIP 159.100.241.235 it allows to automatically configure it and use it for SSH access after deployment, for CentOS.

#cloud-config
write_files:
-   content: |
        # EIP configuration
        DEVICE=lo:1
        IPADDR=159.100.241.235
        NETMASK=255.255.255.255
        ONBOOT=yes
        NAME=lo1
    owner: root:root
    path: '/etc/sysconfig/network-scripts/ifcfg-lo:1'
    permissions: '0644'

runcmd:
 - [ifup, 'lo:1']

Virtual Desktop

#cloud-config
apt_upgrade: true
apt:
  sources:
    java:
      source: "ppa:webupd8team/java"
    intellij:
      source: "ppa:ubuntuhandbook1/apps"
packages:
  - software-properties-common
  - htop
  - build-essential
  - make
  - ubuntu-desktop
  - gnome-session-flashback
  - xrdp
  - intellij-idea-community

VM with cs python library on Ubuntu 18.04

#cloud-config
apt_upgrade: true
packages:
  - python3-pip
runcmd:
  - [pip3, install, cs]

Toolbox

#cloud-config
packages:
 - software-properties-common
 - htop
 - build-essential
 - make
 - zlib1g-dev
 - libbz2-dev
 - libsqlite3-dev
 - libc6-dev
 - libgdbm-dev
 - libssl-dev
 - libreadline-dev
 - libncursesw5-dev
 - libmysqlclient-dev
 - python3-pip
 - python3-virtualenv
apt_upgrade: true
runcmd:
 - [apt-get, dist-upgrade, -yy]
 - [apt-get, clean, -yy]
 - [apt-get, autoremove, -yy]
 - [cd, /root]
 - [wget, 'https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz']
 - [tar, xzfv, 'Python-3.6.4.tgz']
 - [cd, 'Python-3.6.4']
 - ['./configure']
 - [make]
 - [make, install]
power_state:
  mode: reboot
  timeout: 30
  condition: True

CloudStack SystemVM

#cloud-config
apt:
  sources:
    rvm:
      source: "ppa:rael-gc/rvm"
packages:
 - software-properties-common
 - htop
 - build-essential
 - sharutils
 - libxslt1-dev
 - libxml2-dev
 - zlib1g-dev
 - ruby
 - ruby-bundler
 - ruby-dev
 - qemu-utils
 - blktap-utils
 - faketime
 - virtualbox
 - virtualbox-guest-utils
 - virtualbox-guest-additions-iso
apt_upgrade: true
power_state:
  mode: reboot
  timeout: 30
  condition: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment