Jonathan made me understand how my previous "can't connect to a server" was
wrong in my head.
Now my next issue. I'm writing a little playbooks that will eventually go
into a "provisioning" playbook to make all my boxes the same.
This next block says the interpreter line is missing from the yum module.
Here's my playbook:
# $Id$
# $Log$
# install and configure standard packages
# :!ansible-playbook -u root -k --limit dvlnx115 --syntax-check %
# :!ansible-playbook -u root -k --limit dvlnx115 %
# :!ansible-playbook -vvv -u root -k --limit dvlnx115 %
---
- hosts: all
gather_facts: no
tasks:
- name: install package ssh
package:
name: ssh
state: present
- name: configure ssh - set the port
replace:
path: /etc/ssh/sshd_config
regexp: '(?i)#Port 22'
replace: Port 22
become: yes
- name: configure ssh - permit root login no
replace:
path: /etc/ssh/sshd_config
regexp: '(?i)#PermitRootLogin .*$'
replace: PermitRootLogin no
become: yes
- name: configure ssh - password authentication yes (1/2)
replace:
path: /etc/ssh/sshd_config
regexp: '(?i)#PasswordAuthentication.*$'
replace: PasswordAuthentication yes
become: yes
- name: configure ssh - password authentication yes (2/2)
replace:
path: /etc/ssh/sshd_config
regexp: '(?i)PasswordAuthentication no'
replace: PasswordAuthentication yes
become: yes
- name: configure ssh - use PAM yes (1/2)
replace:
path: /etc/ssh/sshd_config
regexp: '(?i)#UsePAM .*$'
replace: UsePAM yes
become: yes
- name: configure ssh - use PAM yes (2/2)
replace:
path: /etc/ssh/sshd_config
regexp: '(?i)UsePAM no'
replace: UsePAM yes
become: yes
- name: configure ssh - set the protocol
replace:
path: /etc/ssh/sshd_config
regexp: '(?i)^Protocol 2,'
replace: Protocol 2
become: yes
- name: enable and restart ssh daemon
service:
name: sshd
enabled: yes
state: restarted
become: yes
when: changed.true
When I run this playbook I get:
[meggle1@dvlnx108 playbooks]$ ansible-playbook -u root -k --limit dvlnx115
ssh.yml
SSH password:
PLAY [all]
*************************************************************************************************************************************************
TASK [install package ssh]
*********************************************************************************************************************************
fatal: [dvlnx115]: FAILED! => {"msg": "module (yum) is missing interpreter
line"}
PLAY RECAP
*************************************************************************************************************************************************
dvlnx115 : ok=0 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
[meggle1@dvlnx108 playbooks]$
Both ansible master and test box are CentOS and fully patched and recently
booted.
Jonathan are you looking into this? Some way I can help?
Mike
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/122f0ae7-9790-4709-a9fc-b379641908be%40googlegroups.com.