isinfield.rethinkdb.query (1.0.0) — module

Query a RethinkDB database

| "added in version" 2.10 of isinfield.rethinkdb"

Authors: Ken Sinfield (@isinfield)

beta | supported by Ken Sinfield

Install collection

Install with ansible-galaxy collection install isinfield.rethinkdb:==1.0.0


Add to requirements.yml

  collections:
    - name: isinfield.rethinkdb
      version: 1.0.0

Description

Run a REQL query against a RethinkDB database


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- hosts: localhost
  connection: local
  gather_facts: no
  tasks:
  - name: Select all RethinkDB users
    kensinfield.rethinkdb.query:
      host: "{{host}}"
      user: "{{user}}"
      password: "{{password}}"
      port: "{{port}}"
      query: "db('rethinkdb').table('users')"

  - name: Create a table in the DB named test
    kensinfield.rethinkdb.query:
      host: "{{host}}"
      user: "{{user}}"
      password: "{{password}}"
      port: "{{port}}"
      query: "db('test').table_create('authors')"

Inputs

    
host:
    description:
    - The hostname or IP address (v4 or v6) of the RethinkDB host
    required: true
    type: str

port:
    default: 28015
    description:
    - The TCP port to connect to on the RedthinkDB host
    required: false
    type: int

user:
    description:
    - The RethinkDB user to connect with
    required: true
    type: str

query:
    description:
    - The REQL query statement
    - Requires the db is specified. See examples below
    required: true
    type: str

password:
    description:
    - The RethinkDB user's password
    required: true
    type: str

Outputs

data:
  description: A list of returned documents
  returned: success
  type: list
msg:
  description: A useful message
  returned: fail
  type: str