Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cotech
ansible
Commits
bc3cac8e
Commit
bc3cac8e
authored
7 years ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
Docker upgrade playbook added
parent
8d291b67
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+6
-13
6 additions, 13 deletions
README.md
discourse_upgrade.yml
+1
-1
1 addition, 1 deletion
discourse_upgrade.yml
docker_upgrade.yml
+6
-0
6 additions, 0 deletions
docker_upgrade.yml
roles/docker-upgrade/tasks/main.yml
+64
-0
64 additions, 0 deletions
roles/docker-upgrade/tasks/main.yml
with
77 additions
and
14 deletions
README.md
+
6
−
13
View file @
bc3cac8e
...
@@ -26,22 +26,15 @@ ansible-playbook -u root discourse_upgrade.yml -i "${SERVERNAME}," -e "hostname=
...
@@ -26,22 +26,15 @@ ansible-playbook -u root discourse_upgrade.yml -i "${SERVERNAME}," -e "hostname=
## Docker Upgrade
## Docker Upgrade
Every 3 months there is a new version of
`docker-ce`
released, the steps to upgrade (this could potentially be written as a Ansible Playbook:
At least every 3 months there is a new version of
`docker-ce`
released, see the
[
release notes
](
https://docs.docker.com/release-notes/docker-ce/
)
, to upgrade
Docker CE use this playbook:
```
bash
```
bash
sudo
-i
export
SERVERNAME
=
"community.coops.tech"
su - discourse
ansible-playbook
-u
root docker_upgrade.yml
-i
"
${
SERVERNAME
}
,"
-e
"hostname=
${
SERVERNAME
}
"
cd
/var/discourse
./launcher app stop
exit
apt-get update
apt-get upgrade
service docker status
# check the uptime and that it is running
su - discourse
cd
/var/discourse
./launcher app start
```
```
## Discourse Install
## Discourse Install
Ansible Playbooks to install
Ansible Playbooks to install
...
...
This diff is collapsed.
Click to expand it.
discourse_upgrade.yml
+
1
−
1
View file @
bc3cac8e
---
---
-
name
:
Install
Discourse
-
name
:
Upgrade
Discourse
hosts
:
"
{{
hostname
}}"
hosts
:
"
{{
hostname
}}"
roles
:
roles
:
...
...
This diff is collapsed.
Click to expand it.
docker_upgrade.yml
0 → 100644
+
6
−
0
View file @
bc3cac8e
---
-
name
:
Upgrade Docker CE
hosts
:
"
{{
hostname
}}"
roles
:
-
docker-upgrade
This diff is collapsed.
Click to expand it.
roles/docker-upgrade/tasks/main.yml
0 → 100644
+
64
−
0
View file @
bc3cac8e
---
-
name
:
Stop the Discourse container
command
:
bash launcher stop app
args
:
chdir
:
"
/var/discourse"
become
:
yes
become_user
:
discourse
-
name
:
Update apt package list
apt
:
update_cache
:
yes
-
name
:
Check if the Webarchitects logchange script is installed
command
:
which logchange
register
:
logchange
-
block
:
-
name
:
Get a list of the updates
shell
:
"
apt-show-versions
-b
-u
|
xargs"
register
:
apt_updates
-
name
:
Record the updates in the /root/Changelog
command
:
'
logchange
"{{
apt_updates.stdout
}}
:
Updated"'
when
:
apt_updates.stdout != ""
when
:
logchange.stdout != ""
-
name
:
Check if the Munin apt state file exists
stat
:
path
:
"
/var/lib/munin-node/plugin-state/nobody/plugin-apt.state"
register
:
munin_apt_state
-
block
:
-
name
:
Delete the Munin apt state file
file
:
dest
:
"
/var/lib/munin-node/plugin-state/nobody/plugin-apt.state"
state
:
absent
-
name
:
Update the Munin apt state file
command
:
munin-run apt_all
when
:
munin_apt_state.stat.exists == True
-
name
:
Update all packages
apt
:
upgrade
:
dist
autoclean
:
yes
-
name
:
Restart Docker CE
service
:
name
:
docker
state
:
restarted
-
name
:
Start the Discourse container
command
:
bash launcher start app
args
:
chdir
:
"
/var/discourse"
become
:
yes
become_user
:
discourse
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment