library/roles/virtuoso: Add support for an external repo. Fix the dba password changing mechanism

This commit is contained in:
Andrea Dell'Amico 2015-07-14 14:08:41 +02:00
parent a0d7feb5c1
commit c59e81b940
7 changed files with 35 additions and 17 deletions

View File

@ -43,7 +43,7 @@
when:
- users_system_users is defined
- item.ssh_key is defined
- item.log_as_root == 'True'
- ( item.log_as_root is defined ) and ( item.log_as_root == 'True' )
tags:
- users

View File

@ -1,5 +1,9 @@
---
virtuoso_enabled: True
virtuoso_from_external_repo: False
virtuoso_external_repo_key: 'http://packages.comsode.eu/key/odn.gpg.key'
virtuoso_external_repo: 'deb http://packages.comsode.eu/debian wheezy main'
virtuoso_pkg_state: installed
virtuoso_version: 6.1
virtuoso_user: virtuoso
virtuoso_base_dir: '/var/lib/virtuoso-opensource-{{ virtuoso_version }}'
@ -36,7 +40,6 @@ virtuoso_ini_opts:
virtuoso_set_more_ini_opts: False
#virtuoso_more_ini_opts:
virtuoso_pkg_state: latest
virtuoso_pkg_list:
- virtuoso-opensource
- virtuoso-server

View File

@ -2,4 +2,5 @@
- include: virtuoso-pkgs.yml
- include: virtuoso-conf.yml
- include: manage-service.yml
- include: virtuoso-dba-user.yml

View File

@ -1,12 +1,10 @@
---
- name: Enable and start the virtuoso service
service: name=virtuoso-opensource-{{ virtuoso_version }} state=started enabled=yes
service: name=virtuoso-opensource-{{ virtuoso_version }} state=restarted 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' ]

View File

@ -33,15 +33,3 @@
when: ( virtuoso_user != 'root' )
tags: [ 'virtuoso', 'virtuoso_conf' ]
- name: Create the isql script to change the dba default password
copy: content="set password dba {{ virtuoso_dba_pwd }};\n" dest={{ virtuoso_db_dir }}/.isql_change_dba_pwd owner={{ virtuoso_user }} group={{ virtuoso_user }} mode=0400
when: virtuoso_dba_pwd is defined
tags: [ 'virtuoso', 'virtuoso_conf' ]
- name: Change the default dba password
shell: '{{ virtuoso_isql }} -H localhost -S {{ virtuoso_server_port }} -U dba -P dba < {{ virtuoso_db_dir }}/.isql_change_dba_pwd ; touch {{ virtuoso_db_dir }}/.dba_changed_password'
args:
creates:
'{{ virtuoso_db_dir }}/.dba_changed_password'
when: virtuoso_dba_pwd is defined
tags: [ 'virtuoso', 'virtuoso_conf' ]

View File

@ -0,0 +1,13 @@
---
- name: Create the isql script to change the dba default password
copy: content="set password dba {{ virtuoso_dba_pwd }};\n" dest={{ virtuoso_db_dir }}/.isql_change_dba_pwd owner={{ virtuoso_user }} group={{ virtuoso_user }} mode=0400
when: virtuoso_dba_pwd is defined
tags: [ 'virtuoso', 'virtuoso_conf' ]
- name: Change the default dba password
shell: '{{ virtuoso_isql }} -H localhost -S {{ virtuoso_server_port }} -U dba -P dba < {{ virtuoso_db_dir }}/.isql_change_dba_pwd ; touch {{ virtuoso_db_dir }}/.dba_changed_password'
args:
creates:
'{{ virtuoso_db_dir }}/.dba_changed_password'
when: virtuoso_dba_pwd is defined
tags: [ 'virtuoso', 'virtuoso_conf' ]

View File

@ -1,4 +1,19 @@
---
- name: Install the virtuoso comsode.eu repository key
apt_key: url={{ virtuoso_external_repo_key }} state=present
when: virtuoso_from_external_repo
tags: virtuoso
- name: Install the virtuoso comsode.eu repository config
apt_repository: repo='{{ virtuoso_external_repo }}' state=present update_cache=yes
when: virtuoso_from_external_repo
tags: virtuoso
- name: Disable the virtuoso comsode.eu repository config if we do not want to install from it
apt_repository: repo='{{ virtuoso_external_repo }}' state=absent update_cache=yes
when: not virtuoso_from_external_repo
tags: virtuoso
- name: Install the virtuoso packages
apt: name={{ item }} state={{ virtuoso_pkg_state }}
with_items: virtuoso_pkg_list