Authored by root

Add pass auth for none-key hosts

... ... @@ -102,3 +102,7 @@
10.67.90.14
10.67.90.42
10.67.90.6
[emr-recom:vars]
ansible_ssh_pass='yohoISD@emr12354'
... ...
---
# playbook files for resolv
- hosts: emr-recom
remote_user: root
roles:
- base
... ...
... ... @@ -4,3 +4,4 @@
remote_user: root
roles:
- resolv
- base
... ...
resolv
=========
配置 `/root/.ssh/`
Requirements
------------
`inventory` 文件中存在 `emr-recom`
Example Playbook
----------------
```yml
- hosts: servers
roles:
- base
```
Author Information
------------------
tiexin.yang@yoho.cn
... ...
---
# handlers file for base
... ...
galaxy_info:
author: tiexin.yang@yoho.cn
description: ansible roles for configure .ssh settings
company: yohobuy.com
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
... ...
---
# Configure resolv.conf
# make sure group exists
- name: make sure emr-recom groups exist in inventory file
fail:
msg: "group {{ item }} not exist!"
when: item not in groups
with_items:
- emr-recom
- name: Configure authorized_keys
template:
src: authorized_keys.j2
dest: /root/.ssh/authorized_keys
mode: 0600
... ...
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDO04RuVd9pVx3Clp6aDIfkHnhgXLHv42etM9RP3OoZwXYnL+Bvze4bY9APjALAzwnMvyLbGxoHe3sLurcH5FgLu6YDEA6t+ybxvyWcWloW2w2pDEKB/08NugRoVkNlKXj8a1D4PsiqTMolg92JxGMfdqFmh4/Y6Qnqapdw1+oPew== skey_116044
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCsKadEo3Fq0u6VdGsqnP7eWQrem5Agxsb16YJAuqGeI5EIiv4rw73lui9iS0QUD27XEPauICKdLptruu7miJB+61bqTC2yPJni+Zb8t/HTimXIGtgjX3SNoEje3YtfEvbkYMay2heQEBh9A4PedTGrvz1Lohkb/yNkDu3Obq5Siw== skey_54890
... ...
# {{ ansible_managed }}
{% for i in groups['nameservers'] %}
nameserver {{ i }}
{% endfor %}
{% if nameserver_timeout %}
options timeout: {{ nameserver_timeout }} rotate
{% endif %}
... ...
---
- hosts: localhost
remote_user: root
roles:
- resolv
\ No newline at end of file
... ...
---
# vars file for resolv
\ No newline at end of file
... ...