diff --git a/data_disk/defaults/main.yml b/data_disk/defaults/main.yml new file mode 100644 index 00000000..c3c30df8 --- /dev/null +++ b/data_disk/defaults/main.yml @@ -0,0 +1,7 @@ +--- +# +# Define the following variables to manage additional disks and mount points +additional_disks: False +#disks_and_mountpoints_list: +# - { mountpoint: '/data', device: 'xvda3', fstype: 'xfs', opts: 'noatime', state: 'mounted', create_filesystem: True } + diff --git a/data_disk/tasks/main.yml b/data_disk/tasks/main.yml new file mode 100644 index 00000000..dc57ebd1 --- /dev/null +++ b/data_disk/tasks/main.yml @@ -0,0 +1,16 @@ +--- +- name: Create a file system on the new disks + filesystem: dev=/dev/{{ item.device }} fstype={{ item.fstype }} force=no + with_items: disks_and_mountpoints_list + when: + - additional_disks + - item.create_filesystem + tags: [ 'data_disk', 'mountpoint' ] + +- name: Manage the additional file systems + mount: name={{ item.mountpoint }} src=/dev/{{ item.device }} fstype={{ item.fstype }} opts={{ item.opts }} state={{ item.state }} + with_items: disks_and_mountpoints_list + when: additional_disks + tags: [ 'data_disk', 'mountpoint' ] + + \ No newline at end of file diff --git a/ssh-keys/defaults/main.yml b/ssh-keys/defaults/main.yml index 27e61e12..b69fce4f 100644 --- a/ssh-keys/defaults/main.yml +++ b/ssh-keys/defaults/main.yml @@ -33,6 +33,7 @@ luca_frosini: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDlTQulSJFayTJyOOecgsct35u7uv francesco_mangiacrapa: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDa0NzwaCcauxAFlsupU2xG2eff9nzep9bnb8pISbX2lk+K4yoJvJOAz9W9klJtpPX/IUJx18YR4jjDNcdiYWNh4Y+5jKT2EhSPNkj7Vw2MhA/ZeOrfHx7JNtL8gdxa8XxYB0ZoZqutRppmaRwWmGGwdVh0wyUzWR/v0OT01IuQGYVneLKIjUtx+BcWGsosWISaOQzVbv9iTFbSwgjbkKFHzHasxwKsrK4t1wvbzuxwhVC+5/VKghBJWN219m/PO+itww/fSes0Kp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20150605 +christoph_lange: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvFxHqgmIkBfdyxRCMGhj2R+Bj05EBB7DlBrlKy6eM3K3EnPP+0dlMW+KhGwcu5sHFjyPtdngEO8AX1TQCUgifhd9++fBVAfUfKU5+dUqqyFFeQjQMqbf7pzWCJ9JjQ5tk1If9IzgBe/50ro0SCqIbod3FogSe4RZqQV1P0znxaHt4ngJSRYnRK+6gniMuT+SlcKgjDM8v8RP4ELWvE0ibduUGoyCEzmmroXgymcL7tpqHTdfo8o3mbcwqRGmCHEplQttFG57PwkJlcQvhKuJHo/Sgcyx2WuEFL/vZMFnuXhaNFg7I1UIO9bNwsLjsbnR9FEK9rjwwl8dKQHDh5R1zQ== clange@BACH # Use the list when you want to give access to non root users ssh_users_list: diff --git a/virtuoso/defaults/main.yml b/virtuoso/defaults/main.yml new file mode 100644 index 00000000..09b58e87 --- /dev/null +++ b/virtuoso/defaults/main.yml @@ -0,0 +1,44 @@ +--- +virtuoso_enabled: True +virtuoso_version: 6.1 +virtuoso_user: virtuoso +virtuoso_base_dir: '/var/lib/virtuoso-opensource-{{ virtuoso_version }}' +virtuoso_db_dir: '{{ virtuoso_base_dir }}/db' +virtuoso_error_log: '{{ virtuoso_db_dir }}/virtuoso.log' +virtuoso_log_dir: '/var/log/virtuoso-opensource-{{ virtuoso_version }}' +virtuoso_server_port: 1111 +virtuoso_ssl_server_port: 2111 +virtuoso_http_server: 8890 +virtuoso_http_server_root: '{{ virtuoso_base_dir }}/vsp' + +virtuoso_defaults: + - { key: 'DBPATH', value: '"{{ virtuoso_db_dir }}"' } + - { key: 'RUN', value: '"yes"' } + - { key: 'DAEMONUSER', value: '{{ virtuoso_user }}' } + +virtuoso_ini_opts: + - { section: 'Database', option: 'DatabaseFile', value: '{{ virtuoso_db_dir }}/virtuoso.db' } + - { section: 'Database', option: 'LockFile', value: '{{ virtuoso_db_dir }}/virtuoso.lck' } + - { section: 'Database', option: 'TransactionFile', value: '{{ virtuoso_db_dir }}/virtuoso.trx' } + - { section: 'Database', option: 'xa_persistent_file', value: '{{ virtuoso_db_dir }}/virtuoso.pxa' } + - { section: 'Database', option: 'ErrorLogFile', value: '{{ virtuoso_error_log }}' } + - { section: 'TempDatabase', option: 'DatabaseFile', value: '{{ virtuoso_db_dir }}/virtuoso-temp.db' } + - { section: 'TempDatabase', option: 'TransactionFile', value: '{{ virtuoso_db_dir }}/virtuoso-temp.trx' } + - { section: 'HTTPServer', option: 'ServerRoot', value: '{{ virtuoso_http_server_root }}' } + +virtuoso_pkg_state: latest +virtuoso_pkg_list: + - virtuoso-opensource + - virtuoso-server + - virtuoso-vad-isparql + - virtuoso-vad-bpel + - virtuoso-vad-rdfmappers + - virtuoso-vad-conductor + - virtuoso-vsp-startpage + +virtuoso_install_optional_pkgs: False +virtuoso_optional_pkgs: + - virtuoso-vad-demo + - virtuoso-vad-sparqldemo + - virtuoso-vad-tutorial + - virtuoso-vad-doc diff --git a/virtuoso/handlers/main.yml b/virtuoso/handlers/main.yml new file mode 100644 index 00000000..bc8fa317 --- /dev/null +++ b/virtuoso/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: Start virtuoso + service: name=virtuoso-opensource-{{ virtuoso_version }} state=started + +- name: Restart virtuoso + service: name=virtuoso-opensource-{{ virtuoso_version }} state=restarted diff --git a/virtuoso/tasks/main.yml b/virtuoso/tasks/main.yml new file mode 100644 index 00000000..f3f191b7 --- /dev/null +++ b/virtuoso/tasks/main.yml @@ -0,0 +1,5 @@ +--- +- include: virtuoso-pkgs.yml +- include: virtuoso-conf.yml +- include: manage-service.yml + diff --git a/virtuoso/tasks/manage-service.yml b/virtuoso/tasks/manage-service.yml new file mode 100644 index 00000000..5b2cd0f9 --- /dev/null +++ b/virtuoso/tasks/manage-service.yml @@ -0,0 +1,12 @@ +--- +- name: Enable and start the virtuoso service + service: name=virtuoso-opensource-{{ virtuoso_version }} state=started enabled=yes + when: virtuoso_enabled + ignore_errors: True + tags: [ 'virtuoso', 'virtuoso_conf' ] + +- name: Stop and disable the virtuoso service + service: name=virtuoso-opensource-{{ virtuoso_version }} state=stopped enabled=no + when: not virtuoso_enabled + ignore_errors: True + tags: [ 'virtuoso', 'virtuoso_conf' ] diff --git a/virtuoso/tasks/virtuoso-conf.yml b/virtuoso/tasks/virtuoso-conf.yml new file mode 100644 index 00000000..01e9a3de --- /dev/null +++ b/virtuoso/tasks/virtuoso-conf.yml @@ -0,0 +1,25 @@ +--- +- name: Create the user under which virtuoso will run + user: name={{ virtuoso_user }} createhome=no home={{ virtuoso_base_dir }} comment="Virtuoso User" system=yes state=present + when: ( virtuoso_user != 'root' ) + tags: [ 'virtuoso', 'virtuoso_conf' ] + +- name: Set up the defaults file + action: configfile path=/etc/default/virtuoso-opensource-{{ virtuoso_version }} key={{ item.key }} value="{{ item.value }}" syntax=shell + with_items: virtuoso_defaults + notify: Restart virtuoso + tags: [ 'virtuoso', 'virtuoso_conf' ] + +- name: Set up the virtuoso ini file + ini_file: dest=/etc/virtuoso-opensource-{{ virtuoso_version }}/virtuoso.ini section={{ item.section }} option={{ item.option }} value={{ item.value }} owner=root group=root mode=0444 + with_items: virtuoso_ini_opts + notify: Restart virtuoso + tags: [ 'virtuoso', 'virtuoso_conf' ] + +- name: Set the directory permissions for the virtuoso user + file: path={{ item }} state=directory recurse=yes owner={{ virtuoso_user }} group={{ virtuoso_user }} + with_items: + - '{{ virtuoso_db_dir }}' + - '{{ virtuoso_log_dir }}' + when: ( virtuoso_user != 'root' ) + tags: [ 'virtuoso', 'virtuoso_conf' ] diff --git a/virtuoso/tasks/virtuoso-pkgs.yml b/virtuoso/tasks/virtuoso-pkgs.yml new file mode 100644 index 00000000..f34bd721 --- /dev/null +++ b/virtuoso/tasks/virtuoso-pkgs.yml @@ -0,0 +1,10 @@ +--- +- name: Install the virtuoso packages + apt: name={{ item }} state={{ virtuoso_pkg_state }} + with_items: virtuoso_pkg_list + tags: virtuoso + +- name: Install the virtuoso optional packages + apt: name={{ item }} state={{ virtuoso_pkg_state }} + with_items: virtuoso_optional_pkgs + tags: virtuoso