---
- name: Install core packages
  yum: name={{ item }}
  with_items:
    - vim
    - telnet
    - screen
    - lftp
    - mail
    - unzip
    - libselinux-python
    - tzdata
    - jq
    - wget

- name: sudoers env_keep
  lineinfile: dest=/etc/sudoers
              regexp="Defaults\s*env_keep"
               line="Defaults env_keep +=  \"PATH SSH_AUTH_SOCK\""

- name: Remove secure_path from /etc/sudoers
  lineinfile: dest=/etc/sudoers
              regexp="Defaults\s*secure_path"
              state=absent

- name: Remove requiretty from /etc/sudoers 
  lineinfile: dest=/etc/sudoers
              regexp="Defaults\s*requiretty"
              state=absent

- name: root PATH
  lineinfile: dest=/root/.bash_profile
              line='export PATH=/usr/local/sbin:/usr/local/bin:$PATH'

- name: root .ssh
  file: state=directory mode=0700 path=/root/.ssh

- name: root .ssh/config
  lineinfile: dest=/root/.ssh/config
              line="StrictHostKeyChecking no"
              create=yes
              mode=0600

- name: Copy timezone
  file: src=/usr/share/zoneinfo/Asia/Tokyo dest=/etc/localtime force=true state=link

- name: Change timezone
  lineinfile: dest=/etc/sysconfig/clock regexp="^ZONE=" line="ZONE=\"Asia/Tokyo\""


---
- name: Install core packages
  yum: name={{ item }}
  with_items:
    - vim
    - telnet
    - screen
    - lftp
    - unzip
    - libselinux-python
    - tzdata
    - jq
    - wget

- name: sudoers env_keep
  lineinfile: dest=/etc/sudoers
              regexp="Defaults\s*env_keep"
               line="Defaults env_keep +=  \"PATH SSH_AUTH_SOCK\""

- name: Remove secure_path from /etc/sudoers
  lineinfile: dest=/etc/sudoers
              regexp="Defaults\s*secure_path"
              state=absent

- name: Remove requiretty from /etc/sudoers 
  lineinfile: dest=/etc/sudoers
              regexp="Defaults\s*requiretty"
              state=absent

- name: root PATH
  lineinfile: dest=/root/.bash_profile
              line='export PATH=/usr/local/sbin:/usr/local/bin:$PATH'

- name: root .ssh
  file: state=directory mode=0700 path=/root/.ssh

- name: root .ssh/config
  lineinfile: dest=/root/.ssh/config
              line="StrictHostKeyChecking no"
              create=yes
              mode=0600

- name: Copy timezone
  file: src=/usr/share/zoneinfo/Asia/Tokyo dest=/etc/localtime force=true state=link

- name: Change timezone
  lineinfile: dest=/etc/sysconfig/clock regexp="^ZONE=" line="ZONE=\"Asia/Tokyo\""


Remove a missing package on CentOS/7
Remove a missing package on CentOS/7
