# Can "freebsd-update upgrade" be run non-interactively?



## JustinClift (Sep 21, 2016)

Hi all,

Trying to run a freebsd-update command non-interactively (through Ansible):


```
$ freebsd-update -r 10.3-RELEASE upgrade --not-running-from-cron
```
However, it keeps hanging on wanting interactive input.  Nothing I've tried so far (eg "echo y |", piping a response file, etc) has managed to get around this interactivity problem. eg:


```
Does this look reasonable (y/n)?
```
Nothing in the man page seems to address this, and none of the options in /etc/freebsd-update.conf seem relevant.

Surely there must be some way to force the upgrade command to continue, instead of hanging?


----------



## kpa (Sep 22, 2016)

I doubt that you can do non-interactive updates/upgrades with freebsd-update(8). The --not-running-from-cron is only for the fetch subcommand and does not affect update/upgrade.


----------



## JustinClift (Sep 22, 2016)

Thanks.  To me that sounds like a bug.  It's possible I'm coming at this from the wrong angle though.

What I'm trying to do is stand up new infrastructure servers in the Rackspace Cloud, for a reasonably widely used OSS project.

Rackspace have offered us substantial hosting (so no changing provider), but only have FreeBSD 10.1-RELEASE-p15 available.

Trying to update things to 10.3-RELEASE-<current> while standing things up, as 10.1 is EOL in 3 months.

Babysitting individual server upgrades, when the result doesn't actually needing babysitting, seems non-optimal.  We're not talking hundreds of servers (yet :>), but still...

Should this be approached differently?


----------



## SirDice (Sep 22, 2016)

Have a look at sysutils/firstboot-freebsd-update. Specifically the rc(8) scripts, they do something similar to what you're trying to achieve. The port itself may not be useful for you but there are probably some interesting solutions you can use.


----------



## JustinClift (Sep 22, 2016)

Thanks SirDice.  Tried that now, but no luck.  Still hangs.

Guess we'll either need to build a golden master manually (ugh) to clone from, or look into building from source remotely.  There must be some way of making this work.


----------



## JustinClift (Sep 22, 2016)

The golden master approach for Rackspace seems to be effective, as the Rackspace images already have cloud-init installed.

So, VM's created from the golden master's image (with 10.3-RELEASE-p7 installed) have the right network + hostname details from the very first boot.

Seems like a win.


----------

