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

New to ansible, help me with my YML? #111

Closed
clupss opened this issue Mar 21, 2022 · 6 comments
Closed

New to ansible, help me with my YML? #111

clupss opened this issue Mar 21, 2022 · 6 comments

Comments

@clupss
Copy link

clupss commented Mar 21, 2022

Hi there,
New to ansible.
I got rclone installing fine.
However I am trying to configure my gdrive remote

My YML is as follows:

- name: rClone Google Drive installer & configurator
  hosts: gdrive
  become: true
  roles:
    - rclone
      rclone_config_location: /etc/ansible/playbooks/rclone.conf
      rclone_configs:
        - name: google
          properties:
            type: drive
            client_id: --REDACTED--
            client_secret: --REDACTED--
            scope: drive
            token: ' {"access_token":"--REDACTED--","token_type":"Bearer","refresh_token":"--REDACTED--","expiry":"--REDACTED--"}'
            team_drive: --REDACTED--

The problem I have is that when I run this, I get a YAML error syntax.

ERROR! Syntax Error while loading YAML.
  mapping values are not allowed in this context

The error appears to be in '/etc/ansible/playbooks/rclone.yml': line 7, column 29, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - rclone
      rclone_config_location: /etc/ansible/playbooks/rclone.conf
                            ^ here

I cannot figure out how to define the rclone_configs in the playbook, in a way that it accepts.

I was wondering if someone could help!

Thanks

@clupss
Copy link
Author

clupss commented Mar 21, 2022

Oh, also, I am aware that my definition of rclone_config_location is wrong -- it should be the path on the remote server where I want it stored, but either way, I cant get the playbook to run so it's not relevant at this stage.

@stefangweichinger
Copy link
Owner

You can't just add a variable like that. You have to list it inside a vars: block.

Look at this maybe: #45 (comment)

@clupss
Copy link
Author

clupss commented Mar 21, 2022

Thank you.
I got it working now.
Yes I am very new to this, but perhaps the documentation could be clearer so newbies can understand :)
I appreciate your help.

@clupss clupss closed this as completed Mar 21, 2022
@stefangweichinger
Copy link
Owner

Your issue was more about ansible itself and using roles. Documenting that goes beyond the scope of this small role.
If you have suggestions for improving the examples: PRs welcome ;-)

@clupss
Copy link
Author

clupss commented Mar 21, 2022

Yes, you are correct. This was my fault for sure, as I am new to ansible and was just after some help. I will look at submitting a PR for different examples. I appreciate your work with this Ansible role, and thank you, it works fantastic.

@stefangweichinger
Copy link
Owner

You're welcome. Docs can always be improved, feel free.

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

2 participants