diff --git a/users/tasks/main.yml b/users/tasks/main.yml index c270e78e..c5a2de86 100644 --- a/users/tasks/main.yml +++ b/users/tasks/main.yml @@ -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 diff --git a/virtuoso/defaults/main.yml b/virtuoso/defaults/main.yml index 92d04c59..617d465f 100644 --- a/virtuoso/defaults/main.yml +++ b/virtuoso/defaults/main.yml @@ -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 diff --git a/virtuoso/tasks/main.yml b/virtuoso/tasks/main.yml index f3f191b7..bfbcf305 100644 --- a/virtuoso/tasks/main.yml +++ b/virtuoso/tasks/main.yml @@ -2,4 +2,5 @@ - include: virtuoso-pkgs.yml - include: virtuoso-conf.yml - include: manage-service.yml +- include: virtuoso-dba-user.yml diff --git a/virtuoso/tasks/manage-service.yml b/virtuoso/tasks/manage-service.yml index 5b2cd0f9..71d3e20f 100644 --- a/virtuoso/tasks/manage-service.yml +++ b/virtuoso/tasks/manage-service.yml @@ -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' ] diff --git a/virtuoso/tasks/virtuoso-conf.yml b/virtuoso/tasks/virtuoso-conf.yml index d5055512..9edf4e0a 100644 --- a/virtuoso/tasks/virtuoso-conf.yml +++ b/virtuoso/tasks/virtuoso-conf.yml @@ -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' ] diff --git a/virtuoso/tasks/virtuoso-dba-user.yml b/virtuoso/tasks/virtuoso-dba-user.yml new file mode 100644 index 00000000..5504b873 --- /dev/null +++ b/virtuoso/tasks/virtuoso-dba-user.yml @@ -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' ] diff --git a/virtuoso/tasks/virtuoso-pkgs.yml b/virtuoso/tasks/virtuoso-pkgs.yml index f34bd721..510f04e7 100644 --- a/virtuoso/tasks/virtuoso-pkgs.yml +++ b/virtuoso/tasks/virtuoso-pkgs.yml @@ -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