# roles/el7/tasks/install.yml
#
# Install custom repositories and packages. Repositories should be installed
# using the RPM package. A list of URLs to the RPMs for these repositories
# should be specified in group_vars or host_vars.
---

- name: Custom yum.conf that doesn't keep old kernels
  template:
    src: etc_yum.conf.j2
    dest: /etc/yum.conf
    owner: root
    group: root
    mode: 0644
  tags:
    - el7
    - install

- name: Ensure specified external repositories are installed
  yum:
    pkg: "{{ item }}"
    state: installed
  with_items: el7_repositories
  when: el7_repositories is defined
  tags:
    - el7
    - install

- name: Ensure Ansible dependencies are installed
  yum:
    pkg: "{{ item }}"
    state: installed
  with_items:
    - libselinux-python
  tags:
    - el7
    - install

- name: Ensure specified packages are installed
  yum:
    pkg: "{{ item }}"
    state: installed
  with_items: el7_install_packages
  when: el7_install_packages is defined
  tags:
    - el7
    - install

- name: Ensure specified packages are NOT installed
  yum:
    pkg: "{{ item }}"
    state: absent
  with_items: el7_remove_packages
  when: el7_remove_packages is defined
  tags:
    - el7
    - install


# roles/el7/tasks/install.yml
#
# Install custom repositories and packages. Repositories should be installed
# using the RPM package. A list of URLs to the RPMs for these repositories
# should be specified in group_vars or host_vars.
---

- name: Install Custom yum.conf
  template:
    src: etc_yum.conf.j2
    dest: /etc/yum.conf
    owner: root
    group: root
    mode: 0644
  tags:
    - el7
    - install

- name: Ensure specified external repositories are installed
  yum:
    pkg: "{{ item }}"
    state: installed
  with_items: el7_repositories
  when: el7_repositories is defined
  tags:
    - el7
    - install

- name: Ensure Ansible dependencies are installed
  yum:
    pkg: "{{ item }}"
    state: installed
  with_items:
    - libselinux-python
  tags:
    - el7
    - install

- name: Ensure specified packages are installed
  yum:
    pkg: "{{ item }}"
    state: installed
  with_items: el7_install_packages
  when: el7_install_packages is defined
  tags:
    - el7
    - install

- name: Ensure specified packages are NOT installed
  yum:
    pkg: "{{ item }}"
    state: absent
  with_items: el7_remove_packages
  when: el7_remove_packages is defined
  tags:
    - el7
    - install


Update task comment for yum.conf
Update task comment for yum.conf
