From 7de03e4e519705301265c0415b3c0af85263a7ac Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:52:36 +0200 Subject: Adding upstream version 1:4.13.0. Signed-off-by: Daniel Baumann --- heartbeat/awsvip | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100755 heartbeat/awsvip (limited to 'heartbeat/awsvip') diff --git a/heartbeat/awsvip b/heartbeat/awsvip new file mode 100755 index 0000000..037278e --- /dev/null +++ b/heartbeat/awsvip @@ -0,0 +1,251 @@ +#!/bin/sh +# +# +# Manage Secondary Private IP with Pacemaker +# +# +# Copyright 2016-2018 guessi +# +# 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. +# +# + +# +# Prerequisites: +# +# - preconfigured AWS CLI running environment (AccessKey, SecretAccessKey, etc.) +# - a reserved secondary private IP address for EC2 instances high availablity +# - IAM user role with the following permissions: +# * DescribeInstances +# * AssignPrivateIpAddresses +# * UnassignPrivateIpAddresses +# + +####################################################################### +# Initialization: + +: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} +. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs + +####################################################################### + +# +# Defaults +# +OCF_RESKEY_awscli_default="/usr/bin/aws" +OCF_RESKEY_profile_default="default" +OCF_RESKEY_api_delay_default="3" + +: ${OCF_RESKEY_awscli=${OCF_RESKEY_awscli_default}} +: ${OCF_RESKEY_profile=${OCF_RESKEY_profile_default}} +: ${OCF_RESKEY_api_delay=${OCF_RESKEY_api_delay_default}} + +meta_data() { + cat < + + +1.0 + + +Resource Agent for Amazon AWS Secondary Private IP Addresses. + +It manages AWS Secondary Private IP Addresses with awscli. + +Credentials needs to be setup by running "aws configure". + +See https://aws.amazon.com/cli/ for more information about awscli. + +Amazon AWS Secondary Private IP Address Resource Agent + + + + + +command line tools for aws services + +aws cli tools + + + + + +Valid AWS CLI profile name (see ~/.aws/config and 'aws configure') + +profile name + + + + + +reserved secondary private ip for ec2 instance + +reserved secondary private ip for ec2 instance + + + + + +a short delay between API calls, to avoid sending API too quick + +a short delay between API calls + + + + + + + + + + + + + + + + +END +} + +####################################################################### + +awsvip_usage() { + cat <