--- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: Install influxdb libs pip: name: influxdb state: present - name: Create influxdb database influxdb_database: hostname: "{{ monasca_influxdb_host }}" port: "{{ monasca_influxdb_port }}" username: "{{ monasca_influxdb_admin }}" password: "{{ monasca_influxdb_admin_password }}" database_name: "{{ monasca_influxdb_database }}" state: present - name: Create influxdb retention policy for database influxdb_retention_policy: hostname: "{{ monasca_influxdb_host }}" port: "{{ monasca_influxdb_port }}" database_name: "{{ monasca_influxdb_database }}" username: "{{ monasca_influxdb_admin }}" password: "{{ monasca_influxdb_admin_password }}" policy_name: persister_all duration: "{{ monasca_influxdb_retention_policy }}" replication: "{{ monasca_influxdb_replication_factor }}" - name: Create influxdb users influxdb_user: hostname: "{{ monasca_influxdb_host }}" port: "{{ monasca_influxdb_port }}" database_name: "{{ monasca_influxdb_database }}" username: "{{ monasca_influxdb_admin }}" password: "{{ monasca_influxdb_admin_password }}" user_name: "{{ item.username }}" user_pass: "{{ item.password }}" with_items: - "{{ monasca_influxdb_users }}"