@ -24,74 +24,55 @@ requirements:
- " python >= 2.6 "
- " python >= 2.6 "
- " influxdb >= 0.9 "
- " influxdb >= 0.9 "
options :
options :
hostname :
description :
- The hostname or IP address on which InfluxDB server is listening
default : localhost
required : false
user_name :
user_name :
description :
description :
- User that we want to create
- Name of the user .
default : None
required : True
required : True
user_password :
user_password :
description :
description :
- Password that we want to set for user
- Password to be set for the user .
default : None
required : false
required : false
admin :
admin :
description :
description :
- specify if user should be admin
- Whether the user should be in the admin role or not .
default : False
default : no
required : false
choices : [ yes , no ]
port :
description :
- The port on which InfluxDB server is listening
default : 8086
required : false
state :
state :
description :
description :
- Determines if the database should be created or destroyed
- State of the user .
choices : [ ' present ' , ' absent ' ]
choices : [ present , absent ]
default : present
default : present
required : false
extends_documentation_fragment : influxdb
username :
description :
- user to auth with influxdb
default : root
required : false
password :
description :
- password to auth username with influxdb
default : root
required : false
'''
'''
EXAMPLES = '''
EXAMPLES = '''
# Example influxdb_user command from Ansible Playbooks
- name : Create a user on localhost using default login credentials
- name : Create User
influxdb_user :
influxdb_user :
user_name : " {{ influxdb_user_name}} "
user_name : john
user_password : " {{ influxdb_user_password}} "
user_password : s3cr3t
state : present
- name : Destroy User
- name : Create a user on localhost using custom login credentials
influxdb_user :
influxdb_user :
user_name : " {{ influxdb_user_name}} "
user_name : john
username : " {{ influxdb_password}} "
user_password : s3cr3t
password : " {{ influxdb_user_password }}"
login_username : " {{ influxdb_username }}"
state : absent
login_password : " {{ influxdb_password }} "
- name : Create user on dest host
- name : Create an admin user on a remote host using custom login credentials
influxdb_user :
user_name : john
user_password : s3cr3t
admin : yes
hostname : " {{ influxdb_hostname }} "
login_username : " {{ influxdb_username }} "
login_password : " {{ influxdb_password }} "
- name : Destroy a user using custom login credentials
influxdb_user :
influxdb_user :
hostname : " {{ influxdb_ip_address}} "
user_name : john
username : " {{ influxdb_username}} "
login_username : " {{ influxdb_username }} "
password : " {{ influxdb_password}} "
login_password : " {{ influxdb_password }} "
user_name : " {{ influxdb_user_name}} "
state : absent
user_password : " {{ influxdb_user_password}} "
admin : true
state : present
'''
'''
RETURN = '''
RETURN = '''