Skip to content

Commit

Permalink
Fixed #78
Browse files Browse the repository at this point in the history
  • Loading branch information
JGillam committed May 7, 2019
1 parent 57a32a9 commit ba8b581
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 24 deletions.
18 changes: 7 additions & 11 deletions Vagrantfile
Expand Up @@ -26,22 +26,18 @@ Vagrant.configure("2") do |config|
# samuraiwtf.vm.provision :shell, inline: "shutdown -r +1"
end

# Make sure VBGuestAdditions is up-to-date and certain pre-requisite packages are installed. Then restart (reload) so we are using the right
# version of VBGuestAdditions before continuing.
samuraiwtf.vm.provision :shell, inline: "apt-get update && apt-get -y install aufs-tools cgroupfs-mount mate-desktop-environment lightdm"
samuraiwtf.vm.provision :reload

samuraiwtf.vm.provision "ansible_local", run: "once" do |ansible1|
ansible1.playbook = "install/bootstrap.yml"
ansible1.playbook = "install/samuraiwtf.yml"
ansible1.version = "latest"
ansible1.install_mode = "pip"
ansible1.compatibility_mode = "2.0"
end

samuraiwtf.vm.provision :reload, run: "once"

samuraiwtf.vm.provision "ansible_local" do |ansible2|
ansible2.playbook = "install/samuraiwtf.yml"
end
# samuraiwtf.vm.provision :shell, path: "install/shared_before.sh"
# samuraiwtf.vm.provision :shell, path: "install/userenv_bootstrap.sh"
# samuraiwtf.vm.provision :shell, path: "install/target_bootstrap.sh"
# samuraiwtf.vm.provision :shell, path: "install/local_targets.sh"

end

#Additional build options. Sepearate virtual machines
Expand Down
32 changes: 19 additions & 13 deletions install/bootstrap.yml
Expand Up @@ -8,13 +8,18 @@
become: true
tasks:

- name: apt upgrade (this may take a while)
- name: Install some dependencies
apt:
upgrade: safe

- name: Install apt https transport
apt:
name: apt-transport-https
name:
- aufs-tools
- cgroupfs-mount
- apt-transport-https
- pigz
- ca-certificates
- curl
- gnupg
- software-properties-common
update_cache: yes

- name: Create samurai user
user:
Expand All @@ -28,12 +33,6 @@
dest: /opt/
mode: 0744

- name: Install desktop environment (this may take a while)
apt:
name:
- mate-desktop-environment
- lightdm

- name: Install dconf
apt:
name:
Expand Down Expand Up @@ -90,9 +89,16 @@
repo: deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
state: present

- name: Install Docker CLI and containerd.io
apt:
name:
- docker-ce-cli
- containerd.io
update_cache: yes
ignore_errors: yes

- name: Install Docker
apt:
name:
- docker-ce
update_cache: yes
ignore_errors: yes
97 changes: 97 additions & 0 deletions install/samuraiwtf.yml
Expand Up @@ -2,8 +2,105 @@
- name: The main SamuraiWTF provisioning playbook
hosts: all
connection: local
become: yes
tasks:

- name: Install some dependencies
apt:
name:
- aufs-tools
- cgroupfs-mount
- apt-transport-https
- pigz
- ca-certificates
- curl
- gnupg
- software-properties-common
update_cache: yes

- name: Create samurai user
user:
name: samurai
password: $1$xyz$YXFPLFW0zK.jHG/.VMUbD/
groups: 'sudo'

- name: Copy configuration files to opt/samurai
copy:
src: ../config/opt/
dest: /opt/
mode: 0744

- name: Install dconf
apt:
name:
- dconf-service
- dconf-cli

# - name: Configure auto login
# block:
# - ini_file:
# path: /etc/lightdm/lightdm.conf
# section: Seat:*
# option: autologin-user
# value: samurai
# - ini_file:
# path: /etc/lightdm/lightdm.conf
# section: Seat:*
# option: autologin-user-timeout
# value: 0

- name: Set greeter screen background image
ini_file:
path: /etc/lightdm/lightdm-gtk-greeter.conf
section: greeter
option: background
value: /opt/samurai/samurai-background.png

- name: Configure desktop environment
debconf:
name: lightdm

- name: Set default background
copy:
src: ../config/opt/samurai/samurai-background.png
dest: /etc/alternatives/desktop-background

- name: Make ansible configuration directory
file:
name: /etc/ansible
state: directory

- name: Create local ansible hosts file
copy:
dest: /etc/ansible/hosts
content: |
samuraiwtf ansible_connection=local ansible_python_interpreter="{{ansible_playbook_python}}"
- name: Add Docker repo key
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present

- name: Add Docker repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
state: present

- name: Install Docker CLI and containerd.io
apt:
name:
- docker-ce-cli
- containerd.io
update_cache: yes
ignore_errors: yes

- name: Install Docker
apt:
name:
- docker-ce
ignore_errors: yes


- import_tasks: menu-tasks.yml


Expand Down

0 comments on commit ba8b581

Please sign in to comment.