---
- name: install the RPM with the pre-built overcloud images
  become: yes
  yum:
      name: "rhosp-director-images"
      state: present

- name: move images (sym link) to home dir
  become: yes
  shell: "cp /usr/share/rhosp-director-images/{{ item }} ~/{{ item }}"
  with_items: "{{ tar_images }}"

- name: untar the images
  become: yes
  unarchive:
      src: "~/{{ item }}"
      dest: "~/"
      copy: "no"
      owner: "{{ installer.user.name }}"
      group: "{{ installer.user.name }}"
  with_items: "{{ tar_images }}"

---
# todo(yfried): block + become
- name: install the RPM with the pre-built overcloud images
  become: yes
  become_method: sudo
  yum:
      name: "rhosp-director-images"
      state: present

- name: move images (sym link) to home dir
  become: yes
  become_method: sudo
  shell: "cp /usr/share/rhosp-director-images/{{ item }} ~/{{ item }}"
  with_items: "{{ tar_images }}"

- name: untar the images
  become: yes
  become_method: sudo
  unarchive:
      src: "~/{{ item }}"
      dest: "~/"
      copy: "no"
      owner: "{{ installer.user.name }}"
      group: "{{ installer.user.name }}"
  with_items: "{{ tar_images }}"

Use sudo for image RPM
Use sudo for image RPM

Change-Id: Ic15c90137f7b76bee2ba318291fbbf3d5d1a1ec0
