A cookook for using keepalived in EC2-VPC environment.
ec2:DescribeInstances
ec2:DescribeNetworkInterfaces
ec2:AttachNetworkInterface
ec2:DetachNetworkInterface
- Amazon Linux
- Chef 12.0 or later
keepalived
- keepalived-ec2 needs keepalived cookook.
TODO: List your cookbook attributes here.
e.g.
Key | Type | Description | Default |
---|---|---|---|
['keepalived-ec2']['bag_name'] | String | bag_name | |
['keepalived-ec2']['item_name'] | String | item_name | |
['keepalived-ec2']['virtual_router_id'] | String | virtual_router_id | 51 |
['keepalived-ec2']['chk_script'] | String | vrrp_script | pidof haproxy |
['keepalived-ec2']['eni'] | String | ENI ID to change in case of failover | |
['keepalived-ec2']['device_index'] | String | Number of eth#{n} you want to set ENI | |
['keepalived-ec2']['master_ip'] | String | MASTER's IP address | |
['keepalived-ec2']['backup_ip'] | String | BACKUP's IP address | |
['keepalived-ec2']['interface'] | String | Interface of NIC with my IP | |
['keepalived-ec2']['state'] | String | MASTER or BACKUP | |
['keepalived-ec2']['conf_template'] | String | The source template to use when creating the keepalived.conf. | default.conf.erb |
{
"id": "item_name"
"AWS_ACCESS_KEY_ID": "XXXXXXXXXXXXXXXXXXXX",
"AWS_SECRET_ACCESS_KEY": "XXXXXXXXXXXXXXXXXXXX"
"AWS_REGION": "XXXXXXXXXXXXXXXXXXXX"
}
{
"name":"master_node",
"run_list": [
"recipe[keepalived-ec2]"
],
"keepalived-ec2" :{
"bag_name": "bag_name",
"item_name": "item_name",
"chk_script": "pidof haproxy",
"eni": "eni-xxxxxxxx",
"device_index": "2",
"interface": "eth1",
"state": "MASTER",
"virtual_router_id": "51",
"master_ip": "10.0.0.110",
"backup_ip": "10.0.0.210"
},
}
{
"name":"backup_node",
"run_list": [
"recipe[keepalived-ec2]"
],
"keepalived-ec2" :{
"bag_name": "bag_name",
"item_name": "item_name",
"chk_script": "pidof haproxy",
"eni": "eni-xxxxxxxx",
"device_index": "2",
"interface": "eth1",
"state": "BACKUP",
"virtual_router_id": "51",
"master_ip": "10.0.0.110",
"backup_ip": "10.0.0.210"
},
}
TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
e.g.
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Authors: cohalz