#ansible (2023-08)

ansible

Discussions related to ansible configuration management

2023-08-24

Balazs Varga avatar
Balazs Varga

I tried to create aws global database with https://docs.ansible.com/ansible/latest/collections/amazon/aws/rds_cluster_module.html module, but I could not make it. I used the following task:

- name: GLOBALDB|CREATE - Create primary
  amazon.aws.rds_cluster:
    cluster_id: "test-cluster-primary"
    engine: "aurora-mysql"
    engine_mode: "global"
    engine_version: "8.0.mysql_aurora.3.04.0"
    vpc_security_group_ids: "sg-12345678976"
    db_subnet_group_name: "db-subnet"
    global_cluster_identifier: "global-test-ansible"
    db_cluster_parameter_group_name: "param-cluster"
    apply_immediately: true
    master_username: test_user
    master_user_password: "PASSWORD.1234!"

It creates the cluster and I can add instance into it with the instance module, but when I use the following task to add read member to the database.

- name: GLOBALDB|CREATE - Add new member to db
  amazon.aws.rds_cluster:
    cluster_id: "test-cluster"
    engine: "aurora-mysql"
    engine_mode: "global"
    engine_version: "8.0.mysql_aurora.3.04.0"
    vpc_security_group_ids: "sg-12345678998"
    db_subnet_group_name: "test"
    replication_source_identifier: "arn:aws:rds:REGION:account:cluster:trst-cluster-primary"
    apply_immediately: true
    global_cluster_identifier: "global-test-ansible"

but I see it created a replica cluster and not a cluster part in global dtabase

    keyboard_arrow_up