---
# tasks file for common

- name: set a root password
  shell: echo "root:odp2105" | chpasswd

- name: get rid of vagrant's bad entry in /etc/hosts
  lineinfile: 
    state=present
    dest=/etc/hosts
    regexp='127.0.0.1.*'
    line='127.0.0.1 localhost localhost.localdomain'

- name: copy vagrant user's .ssh to root
  shell: rm -rf /root/.ssh ; cp -rp /home/vagrant/.ssh /root/. ; chown -R root:root /root/.ssh

#####################################  
# FIX PUPPET BOX's BUSTED SSHD ...
#####################################  
- name: Set the sshd_config back to the original
  copy: src=sshd_config.el7 dest=/etc/ssh/sshd_config
  register: sshdcopy

- service: name=sshd state=restarted
  when: sshdcopy.changed


---
# tasks file for common

- name: get rid of vagrant's bad entry in /etc/hosts
  lineinfile: 
    state=present
    dest=/etc/hosts
    regexp='127.0.0.1.*'
    line='127.0.0.1 localhost localhost.localdomain'

- name: copy vagrant user's .ssh to root
  shell: rm -rf /root/.ssh ; cp -rp /home/vagrant/.ssh /root/. ; chown -R root:root /root/.ssh

#####################################  
# FIX PUPPET BOX's BUSTED SSHD ...
#####################################  

- name: fix the sftp-server path
  lineinfile:
    state=present
    regexp='Subsystem sftp /.*/sftp-server'
    line='Subsystem sftp /usr/libexec/openssh/sftp-server'
    dest=/etc/ssh/sshd_config
  register: lf

- name: restart sshd
  service: name=sshd state=restarted
  when: lf.changed

- name: set a root password
  shell: echo "root:odp2105" | chpasswd

Add better method for fixing the real sftp issue
Add better method for fixing the real sftp issue
