Install cloud requirements to the existing venv

This commit is contained in:
Jack Ivanov 2019-08-22 20:33:56 +02:00
parent 3225cf34c4
commit fa8a7ac5c4
21 changed files with 183 additions and 255 deletions

View file

@ -18,9 +18,6 @@ pki_in_tmpfs: true
# If True re-init all existing certificates. Boolean # If True re-init all existing certificates. Boolean
keys_clean_all: False keys_clean_all: False
# Clean up cloud python environments
clean_environment: false
# Deploy StrongSwan to enable IPsec support # Deploy StrongSwan to enable IPsec support
ipsec_enabled: true ipsec_enabled: true

View file

@ -1,5 +1,4 @@
--- ---
azure_venv: "{{ playbook_dir }}/configs/.venvs/azure"
_azure_regions: > _azure_regions: >
[ [
{ {

View file

@ -2,7 +2,6 @@
- name: Build python virtual environment - name: Build python virtual environment
import_tasks: venv.yml import_tasks: venv.yml
- block:
- name: Include prompts - name: Include prompts
import_tasks: prompts.yml import_tasks: prompts.yml
@ -37,5 +36,3 @@
- set_fact: - set_fact:
cloud_instance_ip: "{{ azure_rm_deployment.deployment.outputs.publicIPAddresses.value }}" cloud_instance_ip: "{{ azure_rm_deployment.deployment.outputs.publicIPAddresses.value }}"
ansible_ssh_user: ubuntu ansible_ssh_user: ubuntu
environment:
PYTHONPATH: "{{ azure_venv }}/lib/python2.7/site-packages/"

View file

@ -1,10 +1,4 @@
--- ---
- name: Clean up the environment
file:
dest: "{{ azure_venv }}"
state: absent
when: clean_environment
- name: Install requirements - name: Install requirements
pip: pip:
name: name:
@ -45,5 +39,4 @@
- azure-mgmt-devtestlabs==3.0.0 - azure-mgmt-devtestlabs==3.0.0
- azure-mgmt-loganalytics==0.2.0 - azure-mgmt-loganalytics==0.2.0
state: latest state: latest
virtualenv: "{{ azure_venv }}" virtualenv_python: python3
virtualenv_python: python2.7

View file

@ -1,2 +0,0 @@
---
cloudstack_venv: "{{ playbook_dir }}/configs/.venvs/cloudstack"

View file

@ -60,7 +60,6 @@
cloud_instance_ip: "{{ cs_server.default_ip }}" cloud_instance_ip: "{{ cs_server.default_ip }}"
ansible_ssh_user: ubuntu ansible_ssh_user: ubuntu
environment: environment:
PYTHONPATH: "{{ cloudstack_venv }}/lib/python2.7/site-packages/"
CLOUDSTACK_CONFIG: "{{ algo_cs_config }}" CLOUDSTACK_CONFIG: "{{ algo_cs_config }}"
CLOUDSTACK_REGION: "{{ algo_cs_region }}" CLOUDSTACK_REGION: "{{ algo_cs_region }}"

View file

@ -1,15 +1,8 @@
--- ---
- name: Clean up the environment
file:
dest: "{{ cloudstack_venv }}"
state: absent
when: clean_environment
- name: Install requirements - name: Install requirements
pip: pip:
name: name:
- cs - cs
- sshpubkeys - sshpubkeys
state: latest state: latest
virtualenv: "{{ cloudstack_venv }}" virtualenv_python: python3
virtualenv_python: python2.7

View file

@ -4,5 +4,4 @@ encrypted: "{{ cloud_providers.ec2.encrypted }}"
ec2_vpc_nets: ec2_vpc_nets:
cidr_block: 172.16.0.0/16 cidr_block: 172.16.0.0/16
subnet_cidr: 172.16.254.0/23 subnet_cidr: 172.16.254.0/23
ec2_venv: "{{ playbook_dir }}/configs/.venvs/aws"
existing_eip: "" existing_eip: ""

View file

@ -2,7 +2,6 @@
- name: Build python virtual environment - name: Build python virtual environment
import_tasks: venv.yml import_tasks: venv.yml
- block:
- name: Include prompts - name: Include prompts
import_tasks: prompts.yml import_tasks: prompts.yml
@ -32,5 +31,3 @@
- set_fact: - set_fact:
cloud_instance_ip: "{{ stack.stack_outputs.ElasticIP }}" cloud_instance_ip: "{{ stack.stack_outputs.ElasticIP }}"
ansible_ssh_user: ubuntu ansible_ssh_user: ubuntu
environment:
PYTHONPATH: "{{ ec2_venv }}/lib/python2.7/site-packages/"

View file

@ -1,15 +1,8 @@
--- ---
- name: Clean up the environment
file:
dest: "{{ ec2_venv }}"
state: absent
when: clean_environment
- name: Install requirements - name: Install requirements
pip: pip:
name: name:
- boto>=2.5 - boto>=2.5
- boto3 - boto3
state: latest state: latest
virtualenv: "{{ ec2_venv }}" virtualenv_python: python3
virtualenv_python: python2.7

View file

@ -1,2 +0,0 @@
---
gce_venv: "{{ playbook_dir }}/configs/.venvs/gce"

View file

@ -5,3 +5,4 @@
- requests>=2.18.4 - requests>=2.18.4
- google-auth>=1.3.0 - google-auth>=1.3.0
state: latest state: latest
virtualenv_python: python3

View file

@ -1,2 +0,0 @@
---
hetzner_venv: "{{ playbook_dir }}/configs/.venvs/hetzner"

View file

@ -2,7 +2,6 @@
- name: Build python virtual environment - name: Build python virtual environment
import_tasks: venv.yml import_tasks: venv.yml
- block:
- name: Include prompts - name: Include prompts
import_tasks: prompts.yml import_tasks: prompts.yml
@ -30,5 +29,3 @@
- set_fact: - set_fact:
cloud_instance_ip: "{{ hcloud_server.hcloud_server.ipv4_address }}" cloud_instance_ip: "{{ hcloud_server.hcloud_server.ipv4_address }}"
ansible_ssh_user: root ansible_ssh_user: root
environment:
PYTHONPATH: "{{ hetzner_venv }}/lib/python2.7/site-packages/"

View file

@ -1,14 +1,7 @@
--- ---
- name: Clean up the environment
file:
dest: "{{ hetzner_venv }}"
state: absent
when: clean_environment
- name: Install requirements - name: Install requirements
pip: pip:
name: name:
- hcloud - hcloud
state: latest state: latest
virtualenv: "{{ hetzner_venv }}" virtualenv_python: python3
virtualenv_python: python2.7

View file

@ -1,2 +0,0 @@
---
lightsail_venv: "{{ playbook_dir }}/configs/.venvs/aws"

View file

@ -2,7 +2,6 @@
- name: Build python virtual environment - name: Build python virtual environment
import_tasks: venv.yml import_tasks: venv.yml
- block:
- name: Include prompts - name: Include prompts
import_tasks: prompts.yml import_tasks: prompts.yml
@ -40,5 +39,3 @@
- set_fact: - set_fact:
cloud_instance_ip: "{{ algo_instance['instance']['public_ip_address'] }}" cloud_instance_ip: "{{ algo_instance['instance']['public_ip_address'] }}"
ansible_ssh_user: ubuntu ansible_ssh_user: ubuntu
environment:
PYTHONPATH: "{{ lightsail_venv }}/lib/python2.7/site-packages/"

View file

@ -1,15 +1,8 @@
--- ---
- name: Clean up the environment
file:
dest: "{{ lightsail_venv }}"
state: absent
when: clean_environment
- name: Install requirements - name: Install requirements
pip: pip:
name: name:
- boto>=2.5 - boto>=2.5
- boto3 - boto3
state: latest state: latest
virtualenv: "{{ lightsail_venv }}" virtualenv_python: python3
virtualenv_python: python2.7

View file

@ -1,2 +0,0 @@
---
openstack_venv: "{{ playbook_dir }}/configs/.venvs/openstack"

View file

@ -6,7 +6,6 @@
- name: Build python virtual environment - name: Build python virtual environment
import_tasks: venv.yml import_tasks: venv.yml
- block:
- name: Security group created - name: Security group created
os_security_group: os_security_group:
state: "{{ state|default('present') }}" state: "{{ state|default('present') }}"
@ -78,5 +77,3 @@
- set_fact: - set_fact:
cloud_instance_ip: "{{ os_server['openstack']['public_v4'] }}" cloud_instance_ip: "{{ os_server['openstack']['public_v4'] }}"
ansible_ssh_user: ubuntu ansible_ssh_user: ubuntu
environment:
PYTHONPATH: "{{ openstack_venv }}/lib/python2.7/site-packages/"

View file

@ -1,13 +1,6 @@
--- ---
- name: Clean up the environment
file:
dest: "{{ openstack_venv }}"
state: absent
when: clean_environment
- name: Install requirements - name: Install requirements
pip: pip:
name: shade name: shade
state: latest state: latest
virtualenv: "{{ openstack_venv }}" virtualenv_python: python3
virtualenv_python: python2.7