Skip to content

Commit

Permalink
update sample application
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Moussaud committed Apr 22, 2020
1 parent 635cee1 commit e4a4932
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/main/resources/ansible_step/ansible-playbook.sh.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ cat ansible_step/inventory/xldeploy_ansible_inventory
echo "= extra vars = "
cat ansible_step/xldeploy_extravars.json


echo "------ "
find . -ls
echo "------ "
cp -r . /tmp/ANSIBLE/
</#if>

echo "${ansibleController.ansiblePlaybookPath} --inventory-file=ansible_step/inventory/xldeploy_ansible_inventory ${verbose} --extra-vars "@ansible_step/xldeploy_extravars.json" ./xldeploy_playbook.yml"
echo "${ansibleController.ansiblePlaybookPath} --inventory-file=ansible_step/inventory/xldeploy_ansible_inventory ${verbose} --extra-vars "@ansible_step/xldeploy_extravars.json" ./xldeploy_playbook.yml"
${ansibleController.ansiblePlaybookPath} --inventory-file=ansible_step/inventory/xldeploy_ansible_inventory ${verbose} --extra-vars "@ansible_step/xldeploy_extravars.json" ./xldeploy_playbook.yml


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
-->
# Generated by XLDeploy

<#if host.type == 'overthere.LocalHost'>
#http://ansible.pickle.io/post/86598332429/running-ansible-playbook-in-localhost
${host.name} ansible_connection=local ansible_python_interpreter=/usr/local/bin/python
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/devops-as-code/apply.sh.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
-->

/usr/local/bin/xl --xl-deploy-password ${ansibleController.devopsAsCodePassword} --xl-deploy-username ${ansibleController.devopsAsCodeUsername} --xl-deploy-url ${ansibleController.devopsAsCodeUrl} apply -f ${yaml_file}
/usr/local/bin/xl --xl-deploy-password ${ansibleController.devopsAsCodePassword} --xl-deploy-username ${ansibleController.devopsAsCodeUsername} --xl-deploy-url ${ansibleController.devopsAsCodeUrl} apply -f ${yaml_file}
3 changes: 2 additions & 1 deletion xebialabs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ kind: Import
metadata:
imports:
- xebialabs/defaults.yaml
- xebialabs/application.yaml
- xebialabs/application.yaml
- xebialabs/configuration.yaml
5 changes: 4 additions & 1 deletion xebialabs/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ spec:
roles:
- tomcat8
variables:
public_key_path: ./keypairs/id_rsa.pub
public_key_path: /Users/bmoussaud/.ssh/demo_keypairs/id_rsa.pub
- name: bdd
type: ansible.RolesSpec
scanPlaceholders: False
includeDevOpsAsCodeTask: True
file: !file "artifacts/provision-calculator/0.0.12/roles_backend"
variables:
cng_password: '{{database_password}}'
database_name: '{{database_name}}'
tags:
- backend
roles:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This will configure a default manager-gui and admin-gui user:

mysql_root_password: password
cng_password: cng_password
cng_password: cng_password
database_name: petdatabase
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
- name: Copy my.cnf file with root password credentials in /etc/mysql/mysql.cnf
template: src=templates/my.cnf.j2 dest=/etc/mysql/mysql.cnf owner=root mode=0600

- name: Create a new database with name 'congruencias'
- name: Create a new database with name '{{database_name}}'
mysql_db:
name: congruencias
name: '{{database_name}}'
state: present

- name: Update mysql root password for all root accounts
Expand All @@ -25,8 +25,8 @@
- ::1
- localhost

- name: Create cng_user user for congruencias
mysql_user: user="cng_user" host="%" password={{cng_password}} priv=congruencias.*:ALL,GRANT
- name: Create cng_user user for {{database_name}}
mysql_user: user="cng_user" host="%" password={{cng_password}} priv={{database_name}}.*:ALL,GRANT

- name: Copy configuration file
copy: src=mysqld.cnf dest=/etc/mysql/mysql.conf.d owner=root mode=0640
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ spec:
username: cng_user
password: {{cng_password}}
mySqlHome: /usr
databaseName: congruencias
databaseName: {{database_name}}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
copy: src=context.xml dest=/opt/apache-tomcat-8.5.8/webapps/manager/META-INF/context.xml mode=0640
notify: restart tomcat

- name: Install axis2 war
copy: src=axis2.war dest=/opt/apache-tomcat-8.5.8/webapps/axis2.war mode=0644

- name: systemd daemon-reload
shell: systemctl daemon-reload

Expand Down
10 changes: 10 additions & 0 deletions xebialabs/condiguration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: xl-deploy/v1
kind: Environments
spec:
- name: Environments/calculator/provisioning.config.dev
type: udm.Dictionary
entries:
database_name: my_dev_database
encryptedEntries:
database_password: scott00Tiger

0 comments on commit e4a4932

Please sign in to comment.