220 lines
9.7 KiB
HTML
220 lines
9.7 KiB
HTML
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="en" >
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><link rel="canonical" href="https://docs.savaneprod.fr/Ansible/2023-10-01-nextcloud-docker-update-from-ansible/" />
|
||
<link rel="shortcut icon" href="../../img/favicon.ico" />
|
||
<title>Mise à jour de Nextcloud docker par Ansible - Savanewiki</title>
|
||
<link rel="stylesheet" href="../../css/theme.css" />
|
||
<link rel="stylesheet" href="../../css/theme_extra.css" />
|
||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />
|
||
|
||
<script>
|
||
// Current page data
|
||
var mkdocs_page_name = "Mise \u00e0 jour de Nextcloud docker par Ansible";
|
||
var mkdocs_page_input_path = "Ansible/2023-10-01-nextcloud-docker-update-from-ansible.md";
|
||
var mkdocs_page_url = "/Ansible/2023-10-01-nextcloud-docker-update-from-ansible/";
|
||
</script>
|
||
|
||
<!--[if lt IE 9]>
|
||
<script src="../../js/html5shiv.min.js"></script>
|
||
<![endif]-->
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
||
<script>hljs.highlightAll();</script>
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav" role="document">
|
||
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search">
|
||
<a href="../.." class="icon icon-home"> Savanewiki
|
||
</a><div role="search">
|
||
<form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../..">Home</a>
|
||
</li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">Synology</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../Synology/2024-02-29-customized-dyndns-for-synology/">Mise à jour automatique de l'adresse IP publique dans l'entrée DNS A chez infomaniak</a>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../Synology/2019-09-01-access-synology-with-ssh-asymetrical-key/">Se connecter en SSH au Synology à l'aide d'une clef asymétrique.</a>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../Synology/2019-12-16-wildcard-lets-encrypt-certificate/">Générer et mettre à jour automatiquement un certificat "wildcard" let's encrypt.</a>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../Synology/2020-12-04-borg-backup/">Sauvegarde externalisée grâce à Borg Backup</a>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../Synology/2021-02-06-restore-time-machine-backup/">Restaurer un mac depuis une sauvegarde Time machine.</a>
|
||
</li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">Ansible</span></p>
|
||
<ul class="current">
|
||
<li class="toctree-l1 current"><a class="reference internal current" href="./">Mise à jour de Nextcloud docker par Ansible</a>
|
||
<ul class="current">
|
||
<li class="toctree-l2"><a class="reference internal" href="#prerequis">Prérequis</a>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#le-playbook">Le playbook</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../2023-11-14-savanewiki-plubication/">Publication de Savanewiki</a>
|
||
</li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">Linux</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../Linux/2019-07-09-manipulations-LVM/">Manipulations LVM</a>
|
||
</li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../about/">About</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="../..">Savanewiki</a>
|
||
|
||
</nav>
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="../.." class="icon icon-home" aria-label="Docs"></a></li>
|
||
<li class="breadcrumb-item">Ansible</li>
|
||
<li class="breadcrumb-item active">Mise à jour de Nextcloud docker par Ansible</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
</li>
|
||
</ul>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div class="section" itemprop="articleBody">
|
||
|
||
<h1 id="mise-a-jour-de-nextcloud-docker-par-ansible">Mise à jour de Nextcloud docker par Ansible</h1>
|
||
<h2 id="prerequis">Prérequis</h2>
|
||
<p><a href="../../Synology/2019-09-01-access-synology-with-ssh-asymetrical-key/">Se connecter en SSH au Synology à l’aide d’une clef asymétrique.</a></p>
|
||
<h2 id="le-playbook">Le playbook</h2>
|
||
<pre><code class="language-yaml">---
|
||
- name: Mise à jour du conteneur Nextcloud
|
||
hosts: savaneprod.fr
|
||
vars:
|
||
nc_version: 28.0.5
|
||
tasks:
|
||
- name: Modification de la versions dans le docker-compose
|
||
ansible.builtin.lineinfile:
|
||
path: /volume1/nextcloud/docker-compose.yaml
|
||
backrefs: true
|
||
backup: false
|
||
state: present
|
||
regexp: "^ image: nextcloud:"
|
||
line: " image: nextcloud:{{ nc_version }}"
|
||
|
||
- name: "Téléchargement de l'image nextcloud: {{ nc_version }}"
|
||
community.docker.docker_image:
|
||
# Needed on DSM : pip3 install docker
|
||
name: nextcloud
|
||
source: pull
|
||
tag: '{{ nc_version }}'
|
||
|
||
- name: Compose down & compose up detached
|
||
# Needed on DSM : pip3 install docker-compose
|
||
community.docker.docker_compose:
|
||
project_src: "/volume1/nextcloud"
|
||
recreate: smart
|
||
|
||
- name: Pause en attendant la remontée des conteneurs
|
||
ansible.builtin.pause:
|
||
#minutes: 2
|
||
seconds: 30
|
||
|
||
- name: "Mise à jour de la base de données"
|
||
community.docker.docker_container_exec:
|
||
container: nextcloud_app_1
|
||
tty: true
|
||
user: www-data
|
||
command: "{{ item }}"
|
||
loop:
|
||
- "php occ db:add-missing-columns"
|
||
- "php occ db:add-missing-indices"
|
||
- "php occ db:add-missing-primary-keys"
|
||
- "php occ config:system:set maintenance_window_start --type=integer --value=1"
|
||
|
||
- name: Pause de 1 minute
|
||
ansible.builtin.pause:
|
||
minutes: 1
|
||
|
||
- name: Modification du fichier .htaccess pour Mac
|
||
tags: caldav
|
||
ansible.builtin.lineinfile:
|
||
path: /volume1/nextcloud/data/.htaccess
|
||
backup: false
|
||
state: present
|
||
search_string: "{{ item.search_string }}"
|
||
line: "{{ item.line }}"
|
||
loop:
|
||
- { search_string: 'RewriteRule ^\.well-known/carddav', line: ' RewriteRule ^\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]' }
|
||
- { search_string: 'RewriteRule ^\.well-known/caldav', line: ' RewriteRule ^\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]' }
|
||
|
||
</code></pre>
|
||
<p>=> Cette façon de faire renvoi un problème d'intégrité sur le fichier config.php.</p>
|
||
|
||
</div>
|
||
</div><footer>
|
||
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
|
||
<a href="../../Synology/2021-02-06-restore-time-machine-backup/" class="btn btn-neutral float-left" title="Restaurer un mac depuis une sauvegarde Time machine."><span class="icon icon-circle-arrow-left"></span> Previous</a>
|
||
<a href="../2023-11-14-savanewiki-plubication/" class="btn btn-neutral float-right" title="Publication de Savanewiki">Next <span class="icon icon-circle-arrow-right"></span></a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<!-- Copyright etc -->
|
||
</div>
|
||
|
||
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
</footer>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</section>
|
||
|
||
</div>
|
||
|
||
<div class="rst-versions" role="note" aria-label="Versions">
|
||
<span class="rst-current-version" data-toggle="rst-current-version">
|
||
|
||
|
||
<span><a href="../../Synology/2021-02-06-restore-time-machine-backup/" style="color: #fcfcfc">« Previous</a></span>
|
||
|
||
|
||
<span><a href="../2023-11-14-savanewiki-plubication/" style="color: #fcfcfc">Next »</a></span>
|
||
|
||
</span>
|
||
</div>
|
||
<script src="../../js/jquery-3.6.0.min.js"></script>
|
||
<script>var base_url = "../..";</script>
|
||
<script src="../../js/theme_extra.js"></script>
|
||
<script src="../../js/theme.js"></script>
|
||
<script src="../../search/main.js"></script>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html>
|