Skip to content

Commit

Permalink
Merge pull request #79 from carlwilson/maint/rename-roles
Browse files Browse the repository at this point in the history
MAINT: Remove DDHN remains
  • Loading branch information
carlwilson authored May 29, 2024
2 parents 15e8afe + ab9ee5f commit e8cc39f
Show file tree
Hide file tree
Showing 41 changed files with 160 additions and 160 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This project creates ViPER, the Virtual Preservation Environment for Research. The environment is a virtual machine set up with a set of digital preservation tools installed and ready to use from the desktop.

Supporting documentation is presented in these sections, or you can use [the documentation website](https://openpreserve.github.io/ddhn-forge/):
Supporting documentation is presented in these sections, or you can use [the documentation website](https://viper.openpreserve.org/):

1. [Setup Guide](docs/setup/index.md): How to download and configure ViPER.
2. [User Guide](docs/guide/index.md): Some help getting acquainted with VirtualBox and the environment.
Expand All @@ -13,7 +13,7 @@ Supporting documentation is presented in these sections, or you can use [the doc

## Logging Issues

Should you have problems with ViPER then please [raise a GitHub issue](https://github.com/openpreserve/ddhn-forge/issues/new) on the project GitHub issue tracker [Openpreserve ddhn-forge](https://github.com/openpreserve/ddhn-forge/issues). You're also free to suggest enhancements by [raising an issue](https://github.com/openpreserve/ddhn-forge/issues/new). Please note that this should be limited to ViPER functionality only, tool enhancements should be directed to the relevant sites. If you do not have a GitHub user account you can also post issues via the [OPF contact us page](https://openpreservation.org/contact/)
Should you have problems with ViPER then please [raise a GitHub issue](https://github.com/openpreserve/ViPER/issues/new) on the [project GitHub issue tracker](https://github.com/openpreserve/ViPER/issues). You're also free to suggest enhancements by [raising an issue](https://github.com/openpreserve/ViPER/issues/new). Please note that this should be limited to ViPER functionality only, tool enhancements should be directed to the relevant sites. If you do not have a GitHub user account you can also post issues via the [OPF contact us page](https://openpreservation.org/contact/)

## Quick Start

Expand All @@ -29,7 +29,7 @@ You'll need [Virtual Box](https://www.virtualbox.org/) on your machine to act as
### Downloading the virtual Machine

Rather than build a vagrant machine you can download a [prebuilt OVF file](https://www.virtualbox.org/manual/ch01.html#ovf-about)
which can be downloaded [ViPER](https://viper.openpreservation.org/viper.ova). The download takes some time
which can be downloaded [ViPER](https://ddhn.openpreservation.org/viper.ova). The download takes some time
as it's about 4GB. When it's finished you should have a file called `viper.ova`.

[These instructions](https://www.virtualbox.org/manual/ch01.html#ovf) tell you how to import the OVA file into VirtualBox so you can start it.
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/initialise-env.yml"
ansible.verbose = "vv"
ansible.limit = "env.ddhn.test"
ansible.limit = "env.viper.test"
ansible.inventory_path = "ansible/vagrant.yml"
end
end
File renamed without changes.
2 changes: 1 addition & 1 deletion ansible/initialise-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
- hosts: all
become: true
roles:
- { role: ddhn.setup }
- { role: viper.setup }
- { role: viper.tools }
54 changes: 0 additions & 54 deletions ansible/roles/ddhn.setup/defaults/main.yml

This file was deleted.

15 changes: 0 additions & 15 deletions ansible/roles/ddhn.setup/tasks/desktop.yml

This file was deleted.

17 changes: 0 additions & 17 deletions ansible/roles/ddhn.setup/tasks/main.yml

This file was deleted.

5 changes: 0 additions & 5 deletions ansible/roles/ddhn.setup/templates/etc/hosts.j2

This file was deleted.

2 changes: 0 additions & 2 deletions ansible/roles/ddhn.setup/vars/main.yml

This file was deleted.

54 changes: 54 additions & 0 deletions ansible/roles/viper.setup/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
# viper.setup default values
viper_env_apt_defaults:
# Source control a
- "git"
# Debian Stretch lacks the ability to download apt over HTTPS
- "apt-transport-https"
# Install some helper network tools
- "psmisc"
- "net-tools"
# Zip and unzip are always handy
- zip
- unzip
# Tools for keyboard and console setup
- keyboard-configuration
- console-setup
# Open JDK 11 for Java
- openjdk-11-jre
- openjdk-11-doc
- openjdk-11-source
# GNOME desktop and Nemo add on for icon display
- task-gnome-desktop
- nemo

viper:
setup:
prereqs:
apt: "{{ viper_env_prereqs_apt | default (viper_env_apt_defaults) }}"
hostname: "{{ viper_env_hostname | default('localhost') }}"
hostdomain: "{{ viper_env_hostdomain | default('localdomain') }}"
fqdn: "{{ viper_env_fqdn | default('localhost.localdomain') }}"
timezone: "{{ viper_env_timezone | default('Europe/London') }}"
iptables:
interfaces: "{{ viper_env_http_interfaces | default([]) }}"
ip:
v4: "{{ viper_env_ip | default('127.0.0.1') }}"
v6: "{{ viper_env_ip_v6 | default('') }}"
port:
http: "{{ viper_env_port_http | default('') }}"
https: "{{ viper_env_port_https | default('') }}"
open_ports: "{{ viper_env_open_ports | default([]) }}"
limited_account:
name: "{{ viper_env_user_name | default('viper') }}"
password: ""
home: "{{ viper_env_user_home | default('/home/viper') }}"
default_locale: en_GB.UTF-8
locales:
- da_DK.UTF-8
- de_DE.UTF-8
- en_GB.UTF-8
- en_US.UTF-8
- fr_FR.UTF-8
- nl_NL.UTF-8

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# ddhn.setup handlers
# viper.setup handlers

- name: restart ssh
service:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ddhn.setup metadata
# viper.setup metadata
---
galaxy_info:
author: "Carl Wilson"
Expand Down
15 changes: 15 additions & 0 deletions ansible/roles/viper.setup/tasks/desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# desktop Environment setup for ViPER tools

- name: "Desktop | Create Nemo config directory."
file:
path: "/home/{{ viper.setup.limited_account.name }}/.config/autostart"
state: directory
mode: '0755'
owner: "{{ viper.setup.limited_account.name }}"
group: "{{ viper.setup.limited_account.name }}"

- name: "Desktop | Add hidden desktop file for Nemo and icons"
copy:
src: "files/home/.config/autostart/nemo-autostart-with-gnome.desktop"
dest: "/home/{{ viper.setup.limited_account.name }}/.config/autostart/nemo-autostart-with-gnome.desktop"
17 changes: 17 additions & 0 deletions ansible/roles/viper.setup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# Main task entry point for ViPER.setup

- name: "ViPER SETUP | Update host OS and setup server."
import_tasks: server.yml

- name: "ViPER SETUP | Install prerequisites."
import_tasks: prerequisites.yml

- name: "ViPER SETUP | Set up user account with SSH key."
import_tasks: user.yml

- name: "ViPER SETUP | Secure server."
import_tasks: security/main.yml

- name: "ViPER SETUP | Setup desktop environment."
import_tasks: desktop.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
# Prerequisites for ddhn.setup
# Prerequisites for viper.setup

- name: "APT | Install apt package pre-requisites."
apt:
name: "{{ ddhn.setup.prereqs.apt }}"
name: "{{ viper.setup.prereqs.apt }}"
state: "latest"

- name: "LOCALE | Set up common locale packages."
community.general.locale_gen:
name: "{{ item }}"
state: present
with_items: "{{ ddhn.setup.locales }}"
with_items: "{{ viper.setup.locales }}"
notify:
- rebuild locales database

- name: "LOCALE | Set default locale."
debconf:
name: locales
question: locales/default_environment_locale
value: "{{ ddhn.setup.default_locale }}"
value: "{{ viper.setup.default_locale }}"
vtype: select
notify:
- rebuild locales database
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Main task entry point for ddhn.setup
# Main task entry point for viper.setup

- name: "DEBCONF | Prevent the iptables-peristent install dialog."
debconf:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Main task entry point for ddhn.setup
# Main task entry point for viper.setup

- name: "IPTABLES V4 | Allow all loopback (lo0) traffic."
iptables:
Expand Down Expand Up @@ -40,12 +40,12 @@
chain: INPUT
in_interface: "{{ item }}"
protocol: tcp
destination_port: "{{ ddhn.setup.port.http }}"
destination_port: "{{ viper.setup.port.http }}"
ctstate: NEW
jump: ACCEPT
comment: "Allow HTTP connections"
with_items: "{{ ddhn.setup.iptables.interfaces }}"
when: ddhn.setup.port.http is defined and ddhn.setup.port.http != ""
with_items: "{{ viper.setup.iptables.interfaces }}"
when: viper.setup.port.http is defined and viper.setup.port.http != ""

- name: "IPTABLES V4 | Allow port traffic from proxy."
iptables:
Expand All @@ -58,20 +58,20 @@
jump: ACCEPT
comment: "Allow TCP connections on port: {{ item }}"
when: opf_proxy_private_ip is defined and opf_proxy_private_ip != ""
with_items: "{{ ddhn.setup.open_ports }}"
with_items: "{{ viper.setup.open_ports }}"

- name: "IPTABLES V4 | Allow HTTPS."
iptables:
action: insert
chain: INPUT
in_interface: "{{ item }}"
protocol: tcp
destination_port: "{{ ddhn.setup.port.https }}"
destination_port: "{{ viper.setup.port.https }}"
ctstate: NEW
jump: ACCEPT
comment: "Allow HTTP connections"
with_items: "{{ ddhn.setup.iptables.interfaces }}"
when: ddhn.setup.port.https is defined and ddhn.setup.port.https != ""
with_items: "{{ viper.setup.iptables.interfaces }}"
when: viper.setup.port.https is defined and viper.setup.port.https != ""

- name: "IPTABLES V4 | Allow inbound traffic from established connections."
iptables:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Main task entry point for ddhn.setup
# Main task entry point for viper.setup

- name: "IPTABLES V6 | Allow all loopback (lo0) traffic."
iptables:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
# Main task entry point for ddhn.setup
# Main task entry point for viper.setup

- name: "IMPORT | IPTABLES rules for IPV4."
import_tasks: ipv4-rules.yml
when: ddhn.setup.ip.v4 is defined and ddhn.setup.ip.v4 != ""
when: viper.setup.ip.v4 is defined and viper.setup.ip.v4 != ""

- name: "IMPORT | IPTABLES rules for IPV6."
import_tasks: ipv6-rules.yml
when: ddhn.setup.ip.v6 is defined and ddhn.setup.ip.v6 != ""
when: viper.setup.ip.v6 is defined and viper.setup.ip.v6 != ""

- name: "IMPORT | Set up persistence for IPTABLES."
import_tasks: iptables-persistent.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Main task entry point for ddhn.setup
# Main task entry point for viper.setup

- name: "IMPORT | Harden SSH access."
import_tasks: ssh.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Main task entry point for ddhn.setup
# Main task entry point for viper.setup

- name: "SSH | Disallow root login."
replace:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
# Server tasks for ddhn.setup
# Server tasks for viper.setup

- name: "APT | Update apt repos and upgrade distro."
apt:
update_cache: "yes"
upgrade: "dist"

- name: "HOST | Set the hostname: {{ ddhn.setup.hostname }}."
- name: "HOST | Set the hostname: {{ viper.setup.hostname }}."
hostname:
name: "{{ ddhn.setup.hostname }}"
name: "{{ viper.setup.hostname }}"

- name: "HOST | Set up /etc/hosts"
template:
src: "etc/hosts.j2"
dest: "/etc/hosts"
owner: "root"

- name: "HOST | Set the timezone: {{ ddhn.setup.timezone }}."
- name: "HOST | Set the timezone: {{ viper.setup.timezone }}."
timezone:
name: "{{ ddhn.setup.timezone }}"
name: "{{ viper.setup.timezone }}"
Loading

0 comments on commit e8cc39f

Please sign in to comment.