Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 May 2022 13:20:37 -0300
From:      Cristian Cardoso <cristian.cardoso11@gmail.com>
To:        Alan Somers <asomers@freebsd.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: Upgrade automation
Message-ID:  <CAKeEC-K=5wOx1UZMy==Nk1_5=Xj1keTjNTn0vffBakv0UBjS-A@mail.gmail.com>
In-Reply-To: <c2881018-8c94-f2fc-0602-bfa57dcba35a@quip.cz>
References:  <CAKeEC-%2Bwqzz_qrHWhCsTGcM9%2B%2BGdMouX8TEGWhCJ2Y%2B5=-nfUA@mail.gmail.com> <CAOtMX2hObotfGtjSoW6HftzP9bZ05d2OPFK2krKW9_6a0r97mQ@mail.gmail.com> <c2881018-8c94-f2fc-0602-bfa57dcba35a@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000f791b305debed2ca
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I create this playbook:


- name: Applying major version upgrade
   command: freebsd-update --not-running-from-cron upgrade -r {{ version }}
   become: yes
   tags:
   - freebsd-upgrade

- name: Apply update installation
   command: freebsd-update --not-running-from-cron install
   become: yes
   tags:
   - freebsd-upgrade

- name: Reboot after upgrade
   shell: "sleep 5 && reboot"
   async: 1
   poll: 0
   become: yes
   tags:
   - freebsd-upgrade


- name: Waiting for machine reboot (max 600s)
   wait_for_connection:
     connect_timeout: 20
     sleep: 20
     delay: 60
     timeout: 600
   tags:
   - freebsd-upgrade

- name: Running freebsd install userland
   command: freebsd-update --not-running-from-cron install
   become: yes
   tags:
   - freebsd-upgrade



But since the command doesn't support -y no -not-running-from-cron for the
upgrade command, I believe everything is stalling on this question and the
playbook has no proceeding and it stays on this question below:

The following components of FreeBSD do not seem to be installed:
world/base-dbg world/lib32-dbg

Does this look reasonable (y/n)?







Em ter., 10 de mai. de 2022 =C3=A0s 13:38, Miroslav Lachman <000.fbsd@quip.=
cz>
escreveu:

> On 10/05/2022 17:46, Alan Somers wrote:
> > On Tue, May 10, 2022 at 9:08 AM Cristian Cardoso
> > <cristian.cardoso11@gmail.com> wrote:
> >>
> >> Hi
> >>
> >> I have some FreeBSD servers in my machine park and I would like to
> perform the version upgrade in an automated way with ansible.
> >>
> >> In my example, I want to perform the upgrade from version 12.3 to 13,
> it is possible to run the upgrade with the command below:
> >>
> >> freebsd-update --not-running-from-cron upgrade -r 12.2-RELEASE
> >>
> >> I ask this, because I don't know if it's the most correct way to
> execute this.
> >>
> >> Grateful for any assistance.
> >
> > Yes, that's perfect.  But there's another step too.  You'll have to do:
> > freebsd-update install
> > And _this_ step isn't easy to perfectly automate, because etcupdate
> > may ask for your input when it merges config files.  If you know
> > exactly which etc files you've modified, you can add them to
> > IgnorePaths.  That way etcupdate won't run interactively, it will
> > simply throw away changes from upstream.
>
> Automation with etcupdate sounds very scary to me because etcupdate
> breaks real life configuration files inplace. Mergemaster did it on
> temporary copies. But if you let etcupdate to left something (after
> merge conflict) in vital config file(s) wich will have syntax error on
> next boot, then you are out.
> It would be much better if etcupdate do not edit target file on merge
> conflicts.
>
> Kind regards
> Miroslav Lachman
>

--000000000000f791b305debed2ca
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">I create this playbook:<div><br></div><di=
v><br></div><div><pre class=3D"gmail-bbCodeCode" dir=3D"ltr" style=3D"box-s=
izing:border-box;font-family:Monaco,Menlo,Consolas,&quot;Roboto Mono&quot;,=
&quot;Andale Mono&quot;,&quot;Ubuntu Mono&quot;,monospace;font-size:13px;ma=
rgin-top:0px;margin-bottom:0px;padding:10px 10px 0px;line-height:1.4;overfl=
ow:auto;direction:ltr;color:rgb(20,20,20);background-color:rgb(246,246,246)=
"><code style=3D"box-sizing:border-box;font-family:inherit;font-size:1em">-=
 name: Applying major version upgrade
   command: freebsd-update --not-running-from-cron upgrade -r {{ version }}
   become: yes
   tags:
   - freebsd-upgrade

- name: Apply update installation
   command: freebsd-update --not-running-from-cron install
   become: yes
   tags:
   - freebsd-upgrade

- name: Reboot after upgrade
   shell: &quot;sleep 5 &amp;&amp; reboot&quot;
   async: 1
   poll: 0
   become: yes
   tags:
   - freebsd-upgrade


- name: Waiting for machine reboot (max 600s)
   wait_for_connection:
     connect_timeout: 20
     sleep: 20
     delay: 60
     timeout: 600
   tags:
   - freebsd-upgrade

- name: Running freebsd install userland
   command: freebsd-update --not-running-from-cron install
   become: yes
   tags:
   - freebsd-upgrade</code></pre></div></div><div><br></div><div><br></div>=
<div>But since the command doesn&#39;t support -y no -not-running-from-cron=
 for the upgrade command, I believe everything is stalling on this question=
 and the playbook has no proceeding and it stays on this question below:<br=
></div><div><br></div><div><pre class=3D"gmail-bbCodeCode" dir=3D"ltr" styl=
e=3D"box-sizing:border-box;font-family:Monaco,Menlo,Consolas,&quot;Roboto M=
ono&quot;,&quot;Andale Mono&quot;,&quot;Ubuntu Mono&quot;,monospace;font-si=
ze:13px;margin-top:0px;margin-bottom:0px;padding:10px 10px 0px;line-height:=
1.4;overflow:auto;direction:ltr;color:rgb(20,20,20);background-color:rgb(24=
6,246,246)"><code style=3D"box-sizing:border-box;font-family:inherit;font-s=
ize:1em">The following components of FreeBSD do not seem to be installed:
world/base-dbg world/lib32-dbg

Does this look reasonable (y/n)?</code></pre></div><div><br></div><div><br>=
</div><div><br></div><div><br></div><div><br></div><br><div class=3D"gmail_=
quote"><div dir=3D"ltr" class=3D"gmail_attr">Em ter., 10 de mai. de 2022 =
=C3=A0s 13:38, Miroslav Lachman &lt;<a href=3D"mailto:000.fbsd@quip.cz">000=
.fbsd@quip.cz</a>&gt; escreveu:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">On 10/05/2022 17:46, Alan Somers wrote:<br>
&gt; On Tue, May 10, 2022 at 9:08 AM Cristian Cardoso<br>
&gt; &lt;<a href=3D"mailto:cristian.cardoso11@gmail.com" target=3D"_blank">=
cristian.cardoso11@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi<br>
&gt;&gt;<br>
&gt;&gt; I have some FreeBSD servers in my machine park and I would like to=
 perform the version upgrade in an automated way with ansible.<br>
&gt;&gt;<br>
&gt;&gt; In my example, I want to perform the upgrade from version 12.3 to =
13, it is possible to run the upgrade with the command below:<br>
&gt;&gt;<br>
&gt;&gt; freebsd-update --not-running-from-cron upgrade -r 12.2-RELEASE<br>
&gt;&gt;<br>
&gt;&gt; I ask this, because I don&#39;t know if it&#39;s the most correct =
way to execute this.<br>
&gt;&gt;<br>
&gt;&gt; Grateful for any assistance.<br>
&gt; <br>
&gt; Yes, that&#39;s perfect.=C2=A0 But there&#39;s another step too.=C2=A0=
 You&#39;ll have to do:<br>
&gt; freebsd-update install<br>
&gt; And _this_ step isn&#39;t easy to perfectly automate, because etcupdat=
e<br>
&gt; may ask for your input when it merges config files.=C2=A0 If you know<=
br>
&gt; exactly which etc files you&#39;ve modified, you can add them to<br>
&gt; IgnorePaths.=C2=A0 That way etcupdate won&#39;t run interactively, it =
will<br>
&gt; simply throw away changes from upstream.<br>
<br>
Automation with etcupdate sounds very scary to me because etcupdate <br>
breaks real life configuration files inplace. Mergemaster did it on <br>
temporary copies. But if you let etcupdate to left something (after <br>
merge conflict) in vital config file(s) wich will have syntax error on <br>
next boot, then you are out.<br>
It would be much better if etcupdate do not edit target file on merge <br>
conflicts.<br>
<br>
Kind regards<br>
Miroslav Lachman<br>
</blockquote></div></div>

--000000000000f791b305debed2ca--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKeEC-K=5wOx1UZMy==Nk1_5=Xj1keTjNTn0vffBakv0UBjS-A>