Skip to content

Commit

Permalink
Added setup of simple authentication and users/roles.properties file
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil A Smith committed Mar 23, 2018
1 parent 09f5c2a commit cac3c31
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 7 deletions.
3 changes: 3 additions & 0 deletions hosts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; This allows you to run the playbooks outside of vagrant provision...
[all]
192.168.30.11 ansible_user=vagrant ansible_ssh_private_key_file=~/workspace/ispyb-devel-env/.vagrant/machines/default/virtualbox/private_key
12 changes: 11 additions & 1 deletion playbooks/roles/dbserver/tasks/setup_ispyb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
password: "{{ ispyb_db_password }}"
state: present
host: localhost
priv: '*.*:ALL'
with_items:
- ispyb_config
- ispyb_db
Expand All @@ -26,9 +27,12 @@
password: "{{ ispyb_db_password }}"
state: present
host: '%'
priv: '*.*:ALL'
with_items:
- "{{ispyb_db_user}}"



- name: Reload Privilege Tables
command: 'mysql -ne "{{ item }}"'
with_items:
Expand All @@ -48,7 +52,9 @@
- "{{ispyb_home}}/ispyb-ejb/db/pyconfig.sql"
- "{{ispyb_home}}/ispyb-ejb/db/pydb.sql"
- "{{ispyb_home}}/ispyb-ejb/db/pyconfig.sql"
ignore_errors: True
ignore_errors: False
tags:
- dbsetup

# As we are running from the trunk - run the ahead scripts as well
- name: Find remote sql update files copied
Expand All @@ -57,6 +63,8 @@
patterns: "*.sql"
recurse: "yes"
register: sql_files
tags:
- dbsetup

- name: Import ispyb database updates
mysql_db:
Expand All @@ -66,3 +74,5 @@
with_items:
- "{{ sql_files.files }}"
ignore_errors: True
tags:
- dbsetup
1 change: 1 addition & 0 deletions playbooks/roles/webserver/files/roles.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
guest=User
13 changes: 7 additions & 6 deletions playbooks/roles/webserver/files/standalone.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,24 @@
<connection-url>jdbc:mysql://{{ispyb_db_host}}:{{ispyb_db_port}}/pyconfig</connection-url>
<driver>mysql-connector-java-5.1.21.jar</driver>
<security>
<user-name>****</user-name>
<password>****</password>
<user-name>{{ispyb_db_user}}</user-name>
<password>{{ispyb_db_password}}</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/ispybDS" pool-name="ispybDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://{{ispyb_db_host}}:{{ispyb_db_port}}/pydb</connection-url>
<driver>mysql-connector-java-5.1.21.jar</driver>
<security>
<user-name>****</user-name>
<password>****</password>
<user-name>{{ispyb_db_user}}</user-name>
<password>{{ispyb_db_password}}</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/ispyb_db_direct" pool-name="ispyb_db_direct" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://{{ispyb_db_host}}:{{ispyb_db_port}}/pydb</connection-url>
<driver>mysql-connector-java-5.1.21.jar</driver>
<security>
<user-name>****</user-name>
<password>****</password>
<user-name>{{ispyb_db_user}}</user-name>
<password>{{ispyb_db_password}}</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
Expand Down Expand Up @@ -485,6 +485,7 @@
<module-option name="groupAttributeID" value="cn"/>
<module-option name="groupCtxDN" value="ou=Pxwebgroups,dc=esrf,dc=fr"/>
</login-module> -->
</login-module>
</authentication>
</security-domain>
<security-domain name="bcr" cache-type="default">
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/webserver/files/users.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
guest=guest
22 changes: 22 additions & 0 deletions playbooks/roles/webserver/tasks/install_ispyb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,25 @@
dest: "{{ ispyb_home }}/configuration/settings.xml"
owner: vagrant
group: vagrant

- name: Ensure wildfly configuration directory exists
file:
path: "{{ wildfly_home }}/standalone/configuration/props/"
state: directory
mode: 0755

- name: Install wildfly authentication files
file:
src: files/users.properties
dest: "{{ wildfly_home }}/standalone/configuration/props/"
owner: vagrant
group: vagrant
ignore_errors: true

- name: Install wildfly authentication files
file:
src: files/roles.properties
dest: "{{ wildfly_home }}/standalone/configuration/props/"
owner: vagrant
group: vagrant
ignore_errors: true

0 comments on commit cac3c31

Please sign in to comment.