emr-resolv.yml 590 Bytes
---
# playbook files for emr resolv
- hosts:  emr-recom,emr-dw
  remote_user: root
  vars:
    nameserver_timeout: 1
  tasks:
  #  make sure group exists
  - name: make sure nameserver groups exist in inventory file
    fail:
      msg: "group {{ item }} not exist!"
    when: item not in groups
    with_items:
      - nameservers
  
  - name: Configure resolv.conf
    template:
      src: resolv.conf.j2
      dest: /etc/resolv.conf
      mode: 0644

  - name: Configure authorized_keys
    template:
      src: authorized_keys.j2
      dest: /root/.ssh/authorized_keys
      mode: 0600