Giter Site home page Giter Site logo

ansible-scaleway's Introduction

ansible-scaleway

Ansible playbook to deploy VM on scaleway IaaS

Create a VM on Scaleway

Prerequisites for Scaleway VM

  • Create an account in Scaleway
  • Generate an SSH key pair (called admin.key and admin.pub)
  • Install prerequisites system packages
sudo apt-get install python3 python3-dev python3-pip build-essential libssl-dev libffi-dev jq
  • Install Python packages on the local machine
pip3 install jinja2 PyYAML paramiko cryptography packaging
  • Install Ansible (ideally from sources, as it evolves really fast)

If you don't want to install it from sources, you can use the PPA (see Ansible documentation)

sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt install ansible

Scaleway token

Create a token in Scaleway to authenticate Ansible access to the Scaleway API. In this repo, an empty environment file has been create with the name scaleway_token. Add you token in it and should look like this:

export SCW_API_KEY='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'

Source the file

source scaleway_token

Create a VM

Use scaleway_create_vm.yaml to:

  • get organisation id of the Scaleway account
  • find a compatible Ubuntu image for the VM
  • add the admin SSH key if necessary
  • create the VM itself
ansible-playbook scaleway_create_vm.yml

If everything works, you should have a new VM in about 2 minutes in your Scaleway console.

Try to initiate a connection to this VM (don't forget to add your SSH key in agent or as an argument in ssh call)

ssh root@IP_found_in_console
[...]
Welcome on Ubuntu Bionic Beaver (18.04 LTS) (GNU/Linux 4.15.0-58-generic x86_64 )

Install python and sudo on Scaleway instance

One issue that comes with Scaleway clean images is that they don't have neither sudo nor python, which will prevent us from using ansible. You can either install them manually, or use the following command to install them from your local machine:

ansible-playbook -i dynamic_inventory.yml -u root scaleway_install_prerequisites.yml

ansible-scaleway's People

Contributors

zwindler avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.