I am receiving an error in my test environment (Ubuntu 18.04) where I want to upload a Docker repository through Ansible. Here is my code:
- name: Add Docker Repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
state: present
The error output I receive is as follows:
{"changed": false, "msg": "Failed to update apt cache: E:The repository 'https://download.docker.com/linux/ubuntu $(lsb_release Release' does not have a Release file."}
I am positive the error is stemming from $(lsb_release -cs) because when I replace that coding with bionic it works. Would this be the only way in moving forward? I would like whatever repository I install to know the version since my script will be covering Ubuntu 16.04, 18.04, and 20.04, and Debian.