por que o apt-get install está pedindo para atualizar o nginx.conf? Como consertar isso usando o chef?

4

Eu estava tentando instalar alguns pacotes que não são relacionados ao nginx (por exemplo, htop) usando script de chef. Mas estava falhando porque está pedindo para atualizar nginx.conf e nginx / sites-available / default. Qual eu posso selecionar usando o chef. (O que eu também não quero substituir, porque quero entender e corrigir o problema em vez de escapar dele)

Assim, tentei instalar o htop sozinho executando o comando sudo apt-get install htop e obtive a seguinte saída.

ubuntu@ip-10-150-4-249:~⟫ sudo apt-get install htop
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  htop
0 upgraded, 1 newly installed, 0 to remove and 160 not upgraded.
3 not fully installed or removed.
Need to get 68.0 kB of archives.
After this operation, 188 kB of additional disk space will be used.
Get:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty/universe htop amd64 1.0.2-3 [68.0 kB]
Fetched 68.0 kB in 0s (5,762 kB/s)
Selecting previously unselected package htop.
(Reading database ... 80711 files and directories currently installed.)
Preparing to unpack .../htop_1.0.2-3_amd64.deb ...
Unpacking htop (1.0.2-3) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up nginx-common (1.8.0-1+trusty1) ...

Configuration file '/etc/nginx/nginx.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** nginx.conf (Y/I/N/O/D/Z) [default=N] ? 

Eu então tentei instalar o cmake sudo apt-get install vim que já estava instalado e ainda tenho o mesmo erro. Saída abaixo

ubuntu@ip-10-162-36-233:~⟫ sudo apt-get install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
vim is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 171 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nginx-common (1.8.0-1+trusty1) ...

Configuration file '/etc/nginx/nginx.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** nginx.conf (Y/I/N/O/D/Z) [default=N] ? 
  1. Eu quero entender por que isso está acontecendo toda vez?
  2. Existe alguma maneira de antecipar esta situação antes que ocorra? porque bloqueia o roteiro do meu chef.
  3. Como faço para corrigir isso usando o chef?
por Rahul Prasad 08.01.2016 / 21:55

1 resposta

4

O Chef executa o apt no modo não interativo para que esses prompts não apareçam para o recurso de pacote do Chef, a versão do arquivo implementado pelo Chef é sempre usada.

    
por 10.01.2016 / 08:01