Merge lp:~mthaddon/mojo/mojo-how-to-focal into lp:mojo/mojo-specs

Proposed by Tom Haddon
Status: Work in progress
Proposed branch: lp:~mthaddon/mojo/mojo-how-to-focal
Merge into: lp:mojo/mojo-specs
Diff against target: 213 lines (+66/-68)
7 files modified
mojo-how-to/devel/build (+1/-4)
mojo-how-to/devel/collect (+3/-3)
mojo-how-to/devel/relations (+25/-12)
mojo-how-to/devel/services (+20/-23)
mojo-how-to/manifest (+3/-5)
mojo-how-to/production/collect (+3/-12)
mojo-how-to/scripts/utils/configure-apache2-vhosts-autocert (+11/-9)
To merge this branch: bzr merge lp:~mthaddon/mojo/mojo-how-to-focal
Reviewer Review Type Date Requested Status
Mojo Maintainers Pending
Review via email: mp+379814@code.launchpad.net

Commit message

mojo-how-to: switch to focal and bundles

Description of the change

mojo-how-to: switch to focal and bundles

To post a comment you must log in.
lp:~mthaddon/mojo/mojo-how-to-focal updated
163. By Tom Haddon

Update autocert to not run in devel

164. By Tom Haddon

Fix template location for production

165. By Tom Haddon

Fix up location of http templates

166. By Tom Haddon

Don't try to set the vhost config twice in devel

Unmerged revisions

166. By Tom Haddon

Don't try to set the vhost config twice in devel

165. By Tom Haddon

Fix up location of http templates

164. By Tom Haddon

Fix template location for production

163. By Tom Haddon

Update autocert to not run in devel

162. By Tom Haddon

Don't overwrite apache config in devel phase with secrets

161. By Tom Haddon

Use the plural of application in bundles

160. By Tom Haddon

Secrets file needs at least one application specified

159. By Tom Haddon

Use local config for services-secret

158. By Tom Haddon

Switch to upstream apache2 charm now it supports focal as well

157. By Tom Haddon

mojo-how-to: prep for focal, switch to bundles

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mojo-how-to/devel/build'
2--- mojo-how-to/devel/build 2020-01-15 09:58:51 +0000
3+++ mojo-how-to/devel/build 2020-02-25 15:42:42 +0000
4@@ -18,8 +18,5 @@
5 # We don't deploy landscape in non-production environments, but we need a
6 # dummy secrets file
7 echo "Creating dummy services-secret file in ${MOJO_LOCAL_DIR}"
8- echo "mojo-how-to:
9- services:
10- nrpe:
11- charm: nrpe" > ${MOJO_LOCAL_DIR}/services-secret
12+ echo "series: ${MOJO_SERIES}" > ${MOJO_LOCAL_DIR}/services-secret
13 fi
14
15=== modified file 'mojo-how-to/devel/collect'
16--- mojo-how-to/devel/collect 2016-03-30 10:00:49 +0000
17+++ mojo-how-to/devel/collect 2020-02-25 15:42:42 +0000
18@@ -1,8 +1,8 @@
19-apache2 lp:charms/trusty/apache2
20+apache2 cs:apache2
21
22 # subordinates
23-content-fetcher lp:~mthaddon/charms/trusty/content-fetcher/trunk
24-nrpe lp:charms/trusty/nrpe
25+content-fetcher cs:~mthaddon/content-fetcher
26+nrpe cs:nrpe
27
28 # content to publish
29 mojo lp:mojo
30
31=== removed file 'mojo-how-to/devel/pre-deploy'
32=== modified file 'mojo-how-to/devel/relations'
33--- mojo-how-to/devel/relations 2016-03-30 10:00:49 +0000
34+++ mojo-how-to/devel/relations 2020-02-25 15:42:42 +0000
35@@ -1,12 +1,25 @@
36-mojo-how-to:
37- series: {{ series }}
38- services:
39- apache2:
40- charm: apache2
41- content-fetcher:
42- charm: content-fetcher
43- nrpe:
44- charm: nrpe
45- relations:
46- - ["apache2", "content-fetcher"]
47- - ["apache2:nrpe-external-master", "nrpe:nrpe-external-master"]
48+series: {{ series }}
49+applications:
50+ apache2:
51+ charm: {{ charm_dir }}/apache2
52+ expose: true
53+ num_units: 1
54+ options:
55+ servername: mojo-how-to.example.com
56+ enable_modules: "ssl"
57+ nagios_check_http_params: "-I 127.0.0.1 -H mojo-how-to-example.com -e '200' -s 'Mojo'"
58+ vhost_http_template: 'include-base64://{{spec_dir}}/{{stage}}/../configs/mojo-how-to-vhost-http.template'
59+ ssl_cert: SELFSIGNED
60+ content-fetcher:
61+ charm: {{ charm_dir }}/content-fetcher
62+ options:
63+ archive_location: file:///home/ubuntu/mojo.tar
64+ dest_dir: /srv/mojo
65+ nrpe:
66+ charm: {{ charm_dir }}/nrpe
67+ options:
68+ procs: '-w 150 -c 200'
69+ swap: '-w 90% -c 75% -n ok'
70+relations:
71+ - ["apache2", "content-fetcher"]
72+ - ["apache2:nrpe-external-master", "nrpe:nrpe-external-master"]
73
74=== modified file 'mojo-how-to/devel/services'
75--- mojo-how-to/devel/services 2016-03-30 10:00:49 +0000
76+++ mojo-how-to/devel/services 2020-02-25 15:42:42 +0000
77@@ -1,23 +1,20 @@
78-mojo-how-to:
79- series: {{ series }}
80- services:
81- apache2:
82- charm: apache2
83- expose: true
84- num_units: 1
85- options:
86- servername: mojo-how-to.example.com
87- enable_modules: "ssl"
88- nagios_check_http_params: "-I 127.0.0.1 -H mojo-how-to-example.com -e '200' -s 'Mojo'"
89- vhost_http_template: 'include-base64://{{spec_dir}}/{{stage}}/../configs/mojo-how-to-vhost-http.template'
90- ssl_cert: SELFSIGNED
91- content-fetcher:
92- charm: content-fetcher
93- options:
94- archive_location: file:///home/ubuntu/mojo.tar
95- dest_dir: /srv/mojo
96- nrpe:
97- charm: nrpe
98- {% if series == "xenial" %}options:
99- procs: '-w 150 -c 200'
100- swap: '-w 90% -c 75% -n ok'{% endif %}
101+series: {{ series }}
102+applications:
103+ apache2:
104+ charm: {{ charm_dir }}/apache2
105+ expose: true
106+ num_units: 1
107+ options:
108+ servername: mojo-how-to.example.com
109+ nagios_check_http_params: "-I 127.0.0.1 -H mojo-how-to-example.com -e '200' -s 'Mojo'"
110+ vhost_http_template: 'include-base64://{{spec_dir}}/{{stage}}/../configs/mojo-how-to-vhost-http.template'
111+ content-fetcher:
112+ charm: {{ charm_dir }}/content-fetcher
113+ options:
114+ archive_location: file:///home/ubuntu/mojo.tar
115+ dest_dir: /srv/mojo
116+ nrpe:
117+ charm: {{ charm_dir }}/nrpe
118+ options:
119+ procs: '-w 150 -c 200'
120+ swap: '-w 90% -c 75% -n ok'
121
122=== modified file 'mojo-how-to/manifest'
123--- mojo-how-to/manifest 2020-01-15 08:25:40 +0000
124+++ mojo-how-to/manifest 2020-02-25 15:42:42 +0000
125@@ -3,16 +3,14 @@
126 # We need the markdown package to be able to generate the docs for Mojo
127 # Run the build step
128 script config=build
129-# Run pre-deploy script
130-script config=pre-deploy
131 # Deploy services only
132-deploy config=services local=services-secret delay=0
133+bundle config=services local=services-secret
134 # Copy our built resources to the instances
135 script config=upload-built-content
136 # And now deploy relations as well
137-deploy config=relations
138+bundle config=relations
139 # Configure deploy autocert managed apache2
140-script config=scripts/utils/configure-apache2-vhosts-autocert APPLICATION=apache2 HTTP_TEMPLATE=${MOJO_STAGE}/../configs//mojo-how-to-production-vhost-http.tmpl HTTPS_TEMPLATE=${MOJO_STAGE}/../configs//mojo-how-to-production-vhost-https.tmpl
141+script config=scripts/utils/configure-apache2-vhosts-autocert APPLICATION=apache2
142 # Run verify steps
143 include config=manifest-verify
144 # Run post deploy steps
145
146=== modified file 'mojo-how-to/production/collect'
147--- mojo-how-to/production/collect 2019-02-04 04:28:17 +0000
148+++ mojo-how-to/production/collect 2020-02-25 15:42:42 +0000
149@@ -1,19 +1,10 @@
150-apache2 lp:charms/trusty/apache2
151-ubuntu lp:~canonical-sysadmins/charms/trusty/ubuntu/trunk
152+apache2 cs:apache2
153
154
155 # subordinates
156 autocert cs:~autocert-charmers/autocert
157-content-fetcher lp:~mthaddon/charms/trusty/content-fetcher/trunk
158-nrpe lp:charms/trusty/nrpe
159-landscape-client cs:{{ series }}/landscape-client
160-ksplice lp:~anthony-fappiano/charms/trusty/ksplice/trunk
161-
162-# basenode
163-apache2/exec.d @
164-apache2/exec.d/basenode lp:~canonical-sysadmins/basenode/trunk
165-ubuntu/exec.d @
166-ubuntu/exec.d/basenode lp:~canonical-sysadmins/basenode/trunk
167+content-fetcher cs:~content-fetcher
168+nrpe cs:nrpe
169
170 # content to publish
171 mojo lp:mojo
172
173=== removed symlink 'mojo-how-to/production/pre-deploy'
174=== target was '../devel/pre-deploy'
175=== modified file 'mojo-how-to/scripts/utils/configure-apache2-vhosts-autocert'
176--- mojo-how-to/scripts/utils/configure-apache2-vhosts-autocert 2019-02-04 07:38:29 +0000
177+++ mojo-how-to/scripts/utils/configure-apache2-vhosts-autocert 2020-02-25 15:42:42 +0000
178@@ -2,16 +2,18 @@
179
180 set -eu
181
182-if [ -z "${HTTP_TEMPLATE:-}" ]; then
183- HTTP_TEMPLATE="${MOJO_STAGE}/templates/vhost-http.tmpl"
184-fi
185-
186-if [ -z "${HTTPS_TEMPLATE:-}" ]; then
187- HTTPS_TEMPLATE="${MOJO_STAGE}/templates/vhost-https.tmpl"
188-fi
189+if [ ${MOJO_STAGE##*/} != "production" ]; then
190+ # We've already set our vhost config, so just exit
191+ exit 0
192+fi
193+
194+HTTP_TEMPLATE="${MOJO_STAGE}/../configs/mojo-how-to-production-vhost-http.template"
195+HTTPS_TEMPLATE="${MOJO_STAGE}/../configs/mojo-how-to-production-vhost-https.template"
196+
197+JUJU_VERSION=$(juju version)
198
199 echo "Checking Juju version..."
200-case $(juju version) in
201+case ${JUJU_VERSION} in
202 1.*)
203 juju_get="juju get"
204 juju_set="juju set"
205@@ -23,7 +25,7 @@
206 juju_run='juju run --application'
207 ;;
208 *)
209- echo "Unknown Juju version $(juju version) detected! Exiting." >&2
210+ echo "Unknown Juju version ${JUJU_VERSION} detected! Exiting." >&2
211 exit 1
212 ;;
213 esac

Subscribers

People subscribed via source and target branches

to all changes: