create vagrant file and adapt process
This commit is contained in:
parent
071ac98956
commit
8bfb3a1361
3
.gitignore
vendored
3
.gitignore
vendored
@ -36,3 +36,6 @@ override.tf.json
|
|||||||
.terraformrc
|
.terraformrc
|
||||||
terraform.rc
|
terraform.rc
|
||||||
site
|
site
|
||||||
|
|
||||||
|
|
||||||
|
.vagrant
|
||||||
|
81
Vagrantfile
vendored
Normal file
81
Vagrantfile
vendored
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
Vagrant.configure('2') do |config|
|
||||||
|
if Vagrant.has_plugin?('vagrant-cachier')
|
||||||
|
config.cache.scope = 'machine'
|
||||||
|
end
|
||||||
|
config.vm.define "oscar-dev" do |c|
|
||||||
|
# Box definition
|
||||||
|
c.vm.box = "archlinux/archlinux"
|
||||||
|
# Config options
|
||||||
|
c.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
c.ssh.insert_key = true
|
||||||
|
c.vm.hostname = "oscar-dev"
|
||||||
|
# Network
|
||||||
|
|
||||||
|
# instance_raw_config_args
|
||||||
|
# Provider
|
||||||
|
c.vm.provider "libvirt" do |libvirt, override|
|
||||||
|
|
||||||
|
libvirt.memory = 1024
|
||||||
|
libvirt.cpus = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "merlin-dev" do |c|
|
||||||
|
# Box definition
|
||||||
|
c.vm.box = "generic/rocky9"
|
||||||
|
# Config options
|
||||||
|
c.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
c.ssh.insert_key = true
|
||||||
|
c.vm.hostname = "merlin-dev"
|
||||||
|
# Network
|
||||||
|
# instance_raw_config_args
|
||||||
|
# Provider
|
||||||
|
c.vm.provider "libvirt" do |libvirt, override|
|
||||||
|
|
||||||
|
libvirt.memory = 1024
|
||||||
|
libvirt.cpus = 2
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "gerard-dev" do |c|
|
||||||
|
# Box definition
|
||||||
|
c.vm.box = "debian/bookworm64"
|
||||||
|
# Config options
|
||||||
|
|
||||||
|
c.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
c.ssh.insert_key = true
|
||||||
|
c.vm.hostname = "gerard-dev"
|
||||||
|
# Network
|
||||||
|
# instance_raw_config_args
|
||||||
|
# Provider
|
||||||
|
c.vm.provider "libvirt" do |libvirt, override|
|
||||||
|
libvirt.memory = 1024
|
||||||
|
libvirt.cpus = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "nas-dev" do |c|
|
||||||
|
# Box definition
|
||||||
|
c.vm.box = "archlinux/archlinux"
|
||||||
|
# Config options
|
||||||
|
c.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
c.ssh.insert_key = true
|
||||||
|
c.vm.hostname = "nas-dev"
|
||||||
|
# Network
|
||||||
|
# instance_raw_config_args
|
||||||
|
# Provider
|
||||||
|
c.vm.provider "libvirt" do |libvirt, override|
|
||||||
|
|
||||||
|
libvirt.memory = 1024
|
||||||
|
libvirt.cpus = 2
|
||||||
|
end
|
||||||
|
|
||||||
|
c.vm.provision "ansible" do |bootstrap|
|
||||||
|
bootstrap.playbook= "ansible/playbooks/bootstrap.yml"
|
||||||
|
bootstrap.galaxy_roles_path= "ansible/roles"
|
||||||
|
bootstrap.limit="all"
|
||||||
|
{ ansible_python_interpreter:"/usr/bin/python3" }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -2,15 +2,12 @@
|
|||||||
requirements:
|
requirements:
|
||||||
ansible-galaxy install -g -r roles/requirements.yml
|
ansible-galaxy install -g -r roles/requirements.yml
|
||||||
|
|
||||||
deploy_production:
|
deploy_production: generate-token
|
||||||
ansible-playbook site.yml -i production -u ansible
|
ansible-playbook site.yml -i production -u ansible
|
||||||
|
|
||||||
|
deploy_staging: generate-token
|
||||||
|
ansible-playbook site.yml -i staging -u ansible
|
||||||
|
|
||||||
generate-token:
|
generate-token:
|
||||||
@echo export VAULT_TOKEN=`vault token create -policy=ansible -field="token" -period 6h`
|
export VAULT_TOKEN=`vault token create -policy=ansible -field="token" -period 6h`
|
||||||
|
|
||||||
|
|
||||||
create-dev: requirements
|
|
||||||
PY_COLORS=1 molecule converge
|
|
||||||
|
|
||||||
destroy-dev:
|
|
||||||
PY_COLORS=1 molecule destroy
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- ansible_bootstrap
|
- ansible_bootstrap
|
||||||
|
Loading…
Reference in New Issue
Block a user