From nobody Wed May 11 16:20:37 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C641C1AD941E for ; Wed, 11 May 2022 16:20:49 +0000 (UTC) (envelope-from cristian.cardoso11@gmail.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kz0Wj14pTz3qXc; Wed, 11 May 2022 16:20:49 +0000 (UTC) (envelope-from cristian.cardoso11@gmail.com) Received: by mail-qt1-x82d.google.com with SMTP id g3so1100206qtb.7; Wed, 11 May 2022 09:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=yfZy4u3jmHCMW8bGr4cy6SgIhAqHyHrJ+JcGrgHahuE=; b=aAnPTS3jc1ueNS41YpW7iV6TBW8A3GmjbMV9+GVGvMDyOl9LSlWyNQ7jwMGgX+Q/JD nNex9bYukZ+zw3D/DSTsYVc2bSCBs//ZfI34KBpQqAMG7nc2s/ngs1t956rAHY/ANF4w yG5YN+P+SWnEK0/NTVZU+kB9ZpGp2R484tB3GBJ4LxkkePfD4Smc+S0HFqXc7N/FCU3y PnnvxqGy+3H62L2J7p8ht573Ow4qG+pKb1SW++1CwfGK6GqzuFixyaWja5JLh9X6hvDE XTItk5ypucUh4TEV1vv53y4j+KFk/OqCCDAdmyPtxaa51oZLncGHJ0ODMmWYG0cIApdw tPHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=yfZy4u3jmHCMW8bGr4cy6SgIhAqHyHrJ+JcGrgHahuE=; b=NTewigbnHoxdmjUq0oYMx2orplD45xbU8KXvRhE4q1EmRc4vLx1//9ELzM1W8iZStO 3+1xN5yGHOGOfbc6U4O1o4BAHbw5Gp7G4RBHVFl6awEfl9Wwr+i2TBAgHO03gL4iU7Vp SZl8jfUHkTOKC18Yo25I+Pq4O1+QrwKYOFnyvBlyQSm5XXTfRuw2EoLfu741uWuS3fB0 9H/4fzJjQYDONv84kDz+hvC86mbv1uI6/+nEclT0M3P2XWEcJw5VQJGYmV9vB5CkrFRW 3UQQP03cJZ/W5zHsFk/76QzJm2VPuc3+BpDRQ+lptmRK/EnyDVCiZtldak6PpE9YL3VW y2Og== X-Gm-Message-State: AOAM532drBApYWV2dQ7Flmgbe1MKHJgJYj8TJ4VzZvAWXnP2bxPHtUvx gAAArA34da9kmQyJ+l+hXmJRGYdcV1f+VXcS9VBsOK4kig== X-Google-Smtp-Source: ABdhPJyhM8cSbDVH2rHyll03NHsohaFKg8WC/WMV7NxzFuNoN4zo+7Pd2nFDBxyTqsrAgxeAFcg3WBb39HkCJxACAOk= X-Received: by 2002:a05:622a:5ca:b0:2f3:ecfb:e062 with SMTP id d10-20020a05622a05ca00b002f3ecfbe062mr5664235qtb.624.1652286048144; Wed, 11 May 2022 09:20:48 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Cristian Cardoso Date: Wed, 11 May 2022 13:20:37 -0300 Message-ID: Subject: Re: Upgrade automation To: Alan Somers , FreeBSD CURRENT Content-Type: multipart/alternative; boundary="000000000000f791b305debed2ca" X-Rspamd-Queue-Id: 4Kz0Wj14pTz3qXc X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=aAnPTS3j; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of cristiancardoso11@gmail.com designates 2607:f8b0:4864:20::82d as permitted sender) smtp.mailfrom=cristiancardoso11@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82d:from]; MLMMJ_DEST(0.00)[freebsd-current]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --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 > > 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
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.=C2=A0 But there's another step too.=C2=A0= You'll have to do:
> freebsd-update install
> And _this_ step isn't easy to perfectly automate, because etcupdat= e
> may ask for your input when it merges config files.=C2=A0 If you know<= br> > exactly which etc files you've modified, you can add them to
> IgnorePaths.=C2=A0 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--