Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible says: "might be an issue with missing quotes" in wireguard.yml. [Ubuntu 18.04.2 LTS] #10

Open
johnnyutahh opened this issue Sep 6, 2019 · 0 comments

Comments

@johnnyutahh
Copy link

Ignorant Ansible user here, trying to install Wireguard simply to the localhost running Ubuntu 18.04.2 LTS. What am I missing?

root@node110 Sep 06 14:19:58 /root# ansible-galaxy install mina-alber.wireguard-ansible
- downloading role 'wireguard-ansible', owned by mina-alber
- downloading role from https://github.com/mina-alber/wireguard-ansible/archive/v1.1.0.tar.gz
- extracting mina-alber.wireguard-ansible to /root/.ansible/roles/mina-alber.wireguard-ansible
- mina-alber.wireguard-ansible (v1.1.0) was installed successfully
root@node110 Sep 06 14:20:03 /root# 

[...]

root@node110 Sep 06 14:28:59 /root/.../roles/mina-alber.wireguard-ansible# ansible-playbook -i hosts_inventory wireguard.yml
ERROR! the role 'wireguard-ansible' was not found in /root/.ansible/roles/mina-alber.wireguard-ansible/roles:/root/.ansible/roles:/root/.ansible/roles/mina-alber.wireguard-ansible

The error appears to have been in '/root/.ansible/roles/mina-alber.wireguard-ansible/wireguard.yml': line 6, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
    - "{{role_name|default('wireguard-ansible')}}"
      ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - "{{ foo }}"

root@node110 Sep 06 14:29:02 /root/.../roles/mina-alber.wireguard-ansible#
root@node110 Sep 06 14:34:22 /root/.../roles/mina-alber.wireguard-ansible# cat hosts_inventory 
[all]

# wireguard    ansible_host=[IP_ADDR]    ansible_port=[SSH_PORT]  ansible_user=root

## Use Python 3 interpreter to make it works with Debian 9/Ubuntu 16.04 or newer.

wireguard    ansible_host=[IP_ADDR]    ansible_port=[SSH_PORT]  ansible_user=root  ansible_python_interpreter=/usr/bin/python3


root@node110 Sep 06 14:34:25 /root/.../roles/mina-alber.wireguard-ansible# cat vars/main.yml 
###########################
## WireGuard Server Vars ##
###########################

wireguard_repo: "https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo"

wireguard_interface_ip: "10.0.5.1/24" # IPADDR/PREFIX
wireguard_port: "51820"

root@node110 Sep 06 14:34:42 /root/.../roles/mina-alber.wireguard-ansible# python3 --version
Python 3.6.8
root@node110 Sep 06 14:34:50 /root/.../roles/mina-alber.wireguard-ansible# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic
root@node110 Sep 06 14:34:59 /root/.../roles/mina-alber.wireguard-ansible#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant