- PIP -
sudo apt-get install python-pip python-dev build-essential
- SoftLayer CLI -
sudo pip install --upgrade pip softlayer
- Ansible v2.0 or newer-
sudo apt-get install ansible
- sshpass -
sudo apt-get install sshpass
- A default SSH key must exist on your local platform. If one does not exist, this can be created via the command
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
.
NOTE: If you encounter SSH issues running from Ubuntu, install sudo pip install requests[security]
first. If that does not eliminate the issue, you may be hitting an issue with GNOME Keyring. See this article for a fix.
Follow this procedure:
- First clone this project:
git clone https://github.com/patrocinio/docker-ddc-softlayer.git
- Edit the file ~/.softlayer to contain the following information:
[softlayer]
username = <IBM Cloud user name>
api_key = <IBM Cloud API key>
endpoint_url = https://api.softlayer.com/xmlrpc/v3.1/
timeout = 0
Check https://knowledgelayer.softlayer.com/procedure/generate-api-key to see how you can generate an API key
-
Optionally, edit the docker-ddc.cfg file to contain the following SoftLayer configuration
- DATACENTER: Run the following command to obtain the data center code:
slcli vs create-options | grep datacenter
- DOMAIN: hostname domain
- SERVER_TYPE: bare for bare metal; anything else for virtual servers
- For virtual servers:
- CPU: Define the number of CPIUs you want in each server
- MEMORY: Define the amount of RAM (in MB) in each server
- For bare metal:
- SIZE: Run
slcli server create-options
for values
- SIZE: Run
- PUBLIC_VLAN: Define the public VLAN number
- PRIVATE_VLAN: Define the private VLAN number
- DATACENTER: Run the following command to obtain the data center code:
-
Run the following command:
deploy-ddc.sh
Simple, no?
Take a look at the following scripts too:
display-ddc.sh
destroy-ddc.sh
remove_api_key.sh
- Disabling GNOME Keyring - Causes interference with some SSH-based actions
- sshpass man page
- sshpass return code 6 - When host key checking causes errors in SSH scripting