CoreOS / systemd não respeita mudanças no resolved.conf

1

Estou usando o CoreOS em um ambiente de openstack e estou usando cloud-config.yml para inicializar o host.

#cloud-config
write_files:
  - path: /etc/systemd/resolved.conf
    permissions: 0644
    owner: root
    content: |
      #  This file is part of systemd.
      #
      #  systemd is free software; you can redistribute it and/or modify it
      #  under the terms of the GNU Lesser General Public License as published by
      #  the Free Software Foundation; either version 2.1 of the License, or
      #  (at your option) any later version.
      #
      # Entries in this file show the compile time defaults.
      # You can change settings by editing this file.
      # Defaults can be restored by simply deleting this file.
      #
      # See resolved.conf(5) for details

      [Resolve]
      DNS=10.8.20.40
      # FallbackDNS=
      # LLMNR=yes

mas isso não reflete o servidor DNS na primeira inicialização. Se eu reiniciar o host CoreOS, funcionará. Como posso fazer com que as alterações no DNS sejam ativadas na primeira inicialização? Existe um comando systemctl restart que eu poderia emitir?

    
por derdewey 03.10.2015 / 06:02

2 respostas

0

O CoreOS não implementa todos os ganchos do cloud-init. No entanto, o que é chamado units

Para a configuração do DNS, use uma unidade de rede como descrita aqui: link

    
por 08.03.2016 / 13:09
0

A melhor solução que encontrei é criar o seu próprio /etc/resolv.conf através da seção write_files como visto neste exemplo cloud-config

#cloud-config
write_files:
  - path: "/etc/resolv.conf"
    permissions: "0644"
    owner: "root"
    content: |
      nameserver 8.8.8.8
    
por 26.05.2016 / 21:22

Tags