Fair enough. Then why wouldn't the following work (trying to copy the RPM
to the host, then running the yum module from that path)?:
- name: Config | Handle RHEL 7 MySQL Connector
when: (guacamole_mysql_auth) and (ansible_distribution_major_version ==
'7')
block:
- name: Copy the RPM locally
ansible.builtin.copy:
src: files/mysql-connector-j-8.0.33-1.el7.noarch.rpm
dest: /var/tmp/
owner: root
group: root
mode: 0644
remote_src: true
- name: Install Latest RHEL 7 MySQL Connector
ansible.builtin.yum:
name: /var/tmp/mysql-connector-j-8.0.33-1.el7.noarch.rpm
state: present
disable_gpg_check: true
- name: Remove local RPM file
ansible.builtin.file:
path: /var/tmp/mysql-connector-j-8.0.33-1.el7.noarch.rpm
state: absent
Thanks,
Harry
On Wednesday, June 7, 2023 at 8:10:42 PM UTC-4 Vladimir Botka wrote:
> On Wed, 7 Jun 2023 11:16:35 -0700 (PDT)
> "[email protected]" <[email protected]> wrote:
>
> > - ansible.builtin.yum:
> > name: files/mysql-connector-j-8.0.33-1.el7.noarch.rpm
> >
> > I even tried to copy the file locally using the copy module with the
> > remote_src flag set to true, but I get the same "file not found" error.
>
> Absolute path on the remote host is required
>
> if spec.endswith('.rpm') or '://' in spec:
> if '://' not in spec and not os.path.exists(spec):
> res['msg'] += "No RPM file matching '%s' found on system" % spec
>
>
> https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/yum.py#L1040
>
>
> --
> Vladimir Botka
>
--
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/2b1e1f92-7a44-4245-91de-65450e1eb2c7n%40googlegroups.com.