@@ -55,6 +55,82 @@ following example to your playbook (e.g. `deploy.yml`):
5555 - acmesoftware.java-deployment
5656` ` `
5757
58+ ### Destination directory structure
59+
60+ On the destination server, the application(s) will be deployed into the ` /opt/{{ deploy_app_name }}/` directory. Unless
61+ configured differently, all directories under that "app root" will be owned by the configured app user and group and
62+ follow a multi-instance structure. For the basic example above, the following deirectories will be generated :
63+
64+ ` ` `
65+ /opt/my-application/
66+ ├── downloads
67+ └── instances
68+ └── 1
69+ ├── app
70+ ├── conf
71+ └── logs
72+ ` ` `
73+
74+ The structure above is fully configurable. See [defaults](defaults/main.yml) for config reference.
75+
76+ # ## Service / Systemloader
77+
78+ This role will, by default, install a service on the target system, which is then used to start & stop each application
79+ instance. The service wrapper to use can be configured using the `d
80+ eploy_service_type` variable. If not configured, we'll
81+ chose the default service wrapper for the target system. Set `deploy_service_type : " none" ` to do nothing and start the
82+ deployed app on your own. See [defaults](defaults/main.yml) for config reference.
83+
84+
85+ ### Deploy Additional Files
86+
87+ Additional files like an ` application.conf`, `logback.xml` or any other file / template can be deployed during the
88+ process. To do so, see the following config example :
89+
90+ ` ` ` yml
91+ - hosts: centos6
92+ vars:
93+ ...
94+ deploy_additional_templates:
95+ - {
96+ src: "templates/application.conf.j2",
97+ dest: "{{ deploy_dir_config }}/application.conf"
98+ }
99+ - {
100+ src: "templates/logback.xml.j2",
101+ dest: "{{ deploy_dir_config }}/logback.xml",
102+ mode: 0600
103+ }
104+ ` ` `
105+
106+ Add one item for every file to be deployed and use the following configuration scheme :
107+
108+ | Property | Mandatory | Description | Default |
109+ | --------- | --------- | --------------------------------------------- | ------------------------ |
110+ | src | yes | Template to render on local machine | - |
111+ | dest | yes | Destination of the file on the local machine | - |
112+ | mode | no | Mode (`chmod`) for the destination file | 0644 |
113+ | user | no | Owner (`chown`) of the destination file | `{{ deploy_app_user }}` |
114+ | group | no | Owner group (`chown`) of the destination file | `{{ deploy_app_group }}` |
115+
116+ ***Note:** These files are deployed per instance, so use the instance directory variables (e.g.
117+ ` {{ deploy_dir_config }}` ) in destination path to prevent override.*
118+
119+ All role variables are accessible within those templates, which is especially beneficial when configuring http ports,
120+ paths, etc. The following example shows a hocon configuration, where those variables are used :
121+
122+ ` ` ` jinja2
123+ example {
124+ http {
125+ # Example to automatically set the application's http port
126+ # This will output port '9001' for instance 1, '9002' for instance 2 and '9108' for instance 108
127+ port: 9{{ '%03d'|format(deploy_instance_nr|int) }}
128+
129+ config-file-ref: {{ deploy_dir_config }}/some_file.txt
130+ }
131+ }
132+ ` ` `
133+
58134Ideas / Todo
59135------------
60136
0 commit comments