First build

This commit is contained in:
JF
2023-11-13 21:28:26 +01:00
parent 349103b31c
commit 190a0f1ac2
47 changed files with 8405 additions and 1 deletions

View File

@@ -0,0 +1,210 @@
<!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/">Liens relatifs à l'utilisation de Synology DSM.</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>
</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 à laide dune 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: 27.1.3
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: &quot;^ image: nextcloud:&quot;
line: &quot; image: nextcloud:{{ nc_version }}&quot;
- name: &quot;Téléchargement de l'image nextcloud: {{ nc_version }}&quot;
community.docker.docker_image:
# Needed on DSM : pip3 install docker
name: nextcloud
source: pull
tag: '{{ nc_version }}'
- name: Compose down &amp; compose up detached
# Needed on DSM : pip3 install docker-compose
community.docker.docker_compose:
project_src: &quot;/volume1/nextcloud&quot;
recreate: smart
- name: Pause de 30 secondes
ansible.builtin.pause:
seconds: 30
- name: Pause en attendant la remontée des conteneurs
ansible.builtin.pause:
minutes: 2
- name: &quot;Mise à jour de la base de données&quot;
community.docker.docker_container_exec:
container: nextcloud_app_1
tty: true
user: www-data
command: &quot;{{ item }}&quot;
loop:
- &quot;php occ db:add-missing-columns&quot;
- &quot;php occ db:add-missing-indices&quot;
- &quot;php occ db:add-missing-primary-keys&quot;
- name: Modification du fichier .htaccess pour Mac
tags: caldav
ansible.builtin.lineinfile:
path: /volume1/nextcloud/data/.htaccess
backup: false
state: present
search_string: &quot;{{ item.search_string }}&quot;
line: &quot;{{ item.line }}&quot;
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>=&gt; 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="../../about/" class="btn btn-neutral float-right" title="About">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">&laquo; Previous</a></span>
<span><a href="../../about/" style="color: #fcfcfc">Next &raquo;</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>