Commit 75245c29 authored by Reimar Stier's avatar Reimar Stier

move disk partition definitions to extra file

parent 4cbe3fdc
...@@ -3,10 +3,15 @@ choco install vagrant ...@@ -3,10 +3,15 @@ choco install vagrant
vagrant plugin install vagrant-disksize vagrant plugin install vagrant-disksize
vagrant plugin install vagrant-proxyconf vagrant plugin install vagrant-proxyconf
# Debug playbook in vagrant box # Debug playbook
* in vagrant box
```
vagrant ssh devbox vagrant ssh devbox
cd /vagrant cd /vagrant
ansible-playbook playbook.yml --connection=local -i devbox, -e ansible_become=true ansible-playbook playbook.yml --connection=local -i devbox, -e ansible_become=true
```
* From controlling host
`ANSIBLE_TAGS=partition vagrant provision`
# SSH configuration # SSH configuration
Provision own ssh key to the vagrant box. Compare [documentation|https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html] Provision own ssh key to the vagrant box. Compare [documentation|https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html]
......
# -*- mode: ruby -*- # -*- mode: ruby -*-
# vi: set ft=ruby : # vi: set ft=ruby :
DISKS = [ require 'yaml'
{ "name" => "home",
"size" => 50,
"port" => 1
},
{ "name" => "opt",
"size" => 15,
"port" => 2 },
{ "name" => "docker",
"size" => 40,
"port" => 3 },
]
DISKS = YAML.load_file('disks.yml')['storage_disks']
BOX_NAME = "devbox" BOX_NAME = "devbox"
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
...@@ -40,7 +30,7 @@ Vagrant.configure("2") do |config| ...@@ -40,7 +30,7 @@ Vagrant.configure("2") do |config|
vb.cpus = 4 vb.cpus = 4
vb.name = BOX_NAME vb.name = BOX_NAME
vb.gui = ENV["SHOW_GUI"] ||= "false" vb.gui = (ENV["SHOW_GUI"] ||= "false").to_s == "true"
# https://www.virtualbox.org/manual/ch08.html # https://www.virtualbox.org/manual/ch08.html
vb.customize ["modifyvm", :id, "--vram", "128"] vb.customize ["modifyvm", :id, "--vram", "128"]
......
[defaults] [defaults]
roles_path = roles:local_roles roles_path=roles:local_roles
---
storage_disks:
- name: "home"
size: 50
port: 1
dev: "/dev/sda"
mount: "/home"
- name: opt
size: 15
port: 2
dev: "/dev/sdb"
mount: "/opt"
- name: docker
size: 40
port: 3
dev: "/dev/sdc"
mount: "/var/lib/docker"
- name: root
size: 40
port: 3
dev: "/dev/sdc"
mount: "/"
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
apt: apt:
update_cache: yes update_cache: yes
cache_valid_time: 86400 # one day cache_valid_time: 86400 # one day
- import_tasks: tasks/partitioning.yml
tags: partition
roles: roles:
- {role: "geerlingguy.docker", docker_users: ["vagrant"], tags: "docker"} - {role: "geerlingguy.docker", docker_users: ["vagrant"], tags: ["docker"]}
- {role: 'jetbrains_installer', tags: ['jetbrains']} - {role: 'jetbrains_installer', tags: ['jetbrains']}
- {role: 'webofmars.xfce4-desktop', tags: ['desktop']} - {role: 'webofmars.xfce4-desktop', tags: ['desktop']}
- {role: 'base', tags: ['base']} - {role: 'base', tags: ['base']}
......
- include_vars: disks.yml
- debug: msg="{{ storage_disks }}"
- debug: msg="{{ ansible_mounts }}"
- debug: msg="{{ ansible_mounts | selectattr('mount', 'match', '^' + disk['mount'] + '$') | list }}"
loop: "{{ storage_disks }}"
loop_control:
loop_var: disk
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment