phoenixnap / phoenixnap.bmc / 1.17.0 / module / server_reserve reserve specific server. | "added in version" 1.15.0 of phoenixnap.bmc" Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com> preview | supported by certifiedphoenixnap.bmc.server_reserve (1.17.0) — module
Install with ansible-galaxy collection install phoenixnap.bmc:==1.17.0
collections: - name: phoenixnap.bmc version: 1.17.0
Reserve specific server.
No actual configuration is performed on the operating system.
This module has a dependency on requests
API is documented at U(https://developers.phoenixnap.com/docs/bmc/1/overview).
# All the examples assume that you have file config.yaml with your 'clientId' and 'clientSecret' # in location: ~/.pnap/config.yaml - name: Create a server reservation for one month hosts: localhost gather_facts: false vars_files: - ~/.pnap/config.yaml tasks: - name: Create a server reservation for one month phoenixnap.bmc.server_reserve: client_id: "{{ clientId }}" client_secret: "{{ clientSecret }}" server_id: e6afba51-7de8-4080-83ab-0f915570659c pricing_model: ONE_MONTH_RESERVATION register: output - name: Print the server information ansible.builtin.debug: var: output.server_reserve
client_id: description: Client ID (Application Management) type: str server_id: description: The server's ID. required: true type: str client_secret: description: Client Secret (Application Management) type: str pricing_model: description: Server pricing model. required: true type: str
server_reserve: contains: clusterId: description: The cluster reference id if any. returned: always sample: x78sdkjds879sd7cx8 type: str coresPerCpu: description: The number of physical cores present on each CPU. returned: always sample: 28 type: int cpu: description: A description of the machine CPU. returned: always sample: E-2276G type: str cpuCount: description: The number of CPUs available in the system. returned: always sample: 2 type: int cpuFrequency: description: The CPU frequency in GHz. returned: always sample: 3.6 type: float description: description: Description of server. returned: always sample: Server type: str hostname: description: Hostname of server. returned: always sample: my-server-1 type: str id: description: The unique identifier of the server. returned: always sample: x78sdkjds879sd7cx8 type: str location: description: Server location ID. Cannot be changed once a server is created. returned: always sample: PHX type: str networkConfiguration: contains: gatewayAddress: description: - The address of the gateway assigned / to assign to the server. - When used as part of request body, IP address has to be part of a private/public network or an IP block assigned to this server. - Gateway address also has to be assigned on an already deployed resource unless the address matches the BMC gateway address in a public network/IP block or the force query parameter is true. sample: 182.16.0.145 type: str ipBlocksConfiguration: contains: configurationType: description: Determines the approach for configuring IP blocks for the server being provisioned. sample: PURCHASE_NEW type: str ipBlocks: contains: id: description: The IP block's ID. sample: 60473a6115e34466c9f8f083 type: str vlanId: description: The VLAN on which this IP block has been configured within the network switch. sample: 10 type: int description: - Used to specify the previously purchased IP blocks to assign to this server upon provisioning - Used alongside the USER_DEFINED configurationType. elements: dict type: list description: - The IP blocks to assign to this server. This is an exclusive allocation, i.e. the IP blocks cannot be shared with other servers. - If IpBlocksConfiguration is not defined, the purchase of a new IP block is determined by the networkType field. type: dict privateNetworkConfiguration: contains: configurationType: description: Determines the approach for configuring private network(s) for the server being provisioned. sample: USER_DEFINED type: str privateNetworks: contains: dhcp: description: Determines whether DHCP is enabled for this server. Should be false if ips is not an empty list. Not supported for proxmox OS. sample: false type: bool id: description: The network identifier. sample: 603f3b2cfcaf050643b89a4b type: str ips: description: IPs to configure/configured on the server. Should be null or empty list if DHCP is true. elements: str sample: - 10.1.1.1 - 10.1.1.2 type: list statusDescription: description: The status of the network. sample: assigned type: str description: The list of private networks this server is member of. elements: dict type: list description: Private network details of bare metal server. type: dict publicNetworkConfiguration: contains: publicNetworks: contains: id: description: The network identifier. sample: 60473c2509268bc77fd06d29 type: str ips: description: IPs to configure/configured on the server. IPs must be within the network's range. elements: str sample: - 182.16.0.146 - 182.16.0.147 type: list statusDescription: description: The status of the assignment to the network. sample: assigned type: str description: The list of public networks this server is member of. elements: dict type: list description: Public network details of bare metal server. type: dict description: Entire network details of bare metal server. type: dict networkType: description: The type of network configuration for this server. returned: always sample: PUBLIC_AND_PRIVATE type: str os: description: The server's OS ID used when the server was created. returned: always sample: ubuntu/bionic type: str osConfiguration: contains: cloudInit: contains: userData: description: User data for the cloud-init configuration in base64 encoding. NoCloud format is supported. type: str description: Cloud-init configuration details. type: dict installOsToRam: description: - If true, OS will be installed to and booted from the server's RAM. - On restart RAM OS will be lost and the server will not be reachable unless a custom bootable OS has been deployed. sample: false type: bool managementAccessAllowedIps: description: - List of IPs allowed to access the Management UI. Supported in single IP, CIDR and range format - When undefined, Management UI is disabled. This will only be returned in response to provisioning a server. elements: str sample: - 172.217.22.14 - 10.111.14.40/29 - 10.111.14.66 - 10.111.14.71 type: list managementUiUrl: description: The URL of the management UI which will only be returned in response to provisioning a server. sample: https://172.217.22.14 type: str netrisController: contains: hostOs: description: Host OS on which the Netris Controller is installed. type: str netrisUserPassword: description: - Auto-generated password set for user 'netris' in the web console. - The password is not stored and therefore will only be returned in response to provisioning a server. - Copy and save it for future reference. type: str netrisWebConsoleUrl: description: The URL for the Netris Controller web console. Will only be returned in response to provisioning a server. type: str description: Netris Controller configuration properties. type: dict netrisSoftgate: contains: controllerAddress: description: IP address or hostname through which to reach the Netris Controller. type: str controllerVersion: description: The version of the Netris Controller to connect to. type: str hostOs: description: Host OS on which the Netris Softgate is installed. type: str description: Netris Softgate configuration properties. type: dict rootPassword: description: Password set for user root on an ESXi server which will only be returned in response to provisioning a server. sample: MyP@ssw0rd_01 type: str windows: contains: rdpAllowedIps: description: - List of IPs allowed for RDP access to Windows OS. Supported in single IP, CIDR and range format. - When undefined, RDP is disabled. To allow RDP access from any IP use 0.0.0.0/0. - This will only be returned in response to provisioning a server. elements: str sample: - 172.217.22.14 - 10.111.14.40/29 - 10.111.14.66 - 10.111.14.71 type: list description: Windows OS configuration properties. type: dict description: OS specific configuration properties. type: dict password: description: Password set for user Admin on Windows server which will only be returned in response to provisioning a server. returned: always sample: MyP@ssw0rd_01 type: str pricingModel: description: The pricing model this server is being billed. returned: always sample: HOURLY type: str privateIpAddresses: description: Private IP addresses assigned to server. returned: always sample: - 172.16.0.1 type: list provisionedOn: description: Date and time when server was provisioned. sample: '2021-03-13T20:24:32.491Z' type: str publicIpAddresses: description: Public IP addresses assigned to server. returned: always sample: - 182.16.0.1 - 183.16.0.1 type: list ram: description: A description of the machine RAM. returned: always sample: 64GB RAM type: str reservationId: description: The reservation reference id if any. returned: always sample: x78sdkjds879sd7cx8 type: str status: description: The status of the server. returned: always sample: powered-on type: str storage: description: A description of the machine storage. returned: always sample: 1x 960GB NVMe type: str storageConfiguration: contains: rootPartition: contains: raid: description: Software RAID configuration. type: str size: description: The size of the root partition in GB. -1 to use all available space. type: int description: Root partition configuration. type: dict description: Storage configuration. type: dict supersededBy: description: Unique identifier of the server to which the reservation has been sample: 64a539b8d9c2c9ba8424ca31 type: str supersedes: description: Unique identifier of the server from which the reservation has been transferred. sample: 76915b5c85121d411f26e92f type: str tags: contains: createdBy: description: Who the tag was created by. sample: USER type: str id: description: The unique id of the tag. sample: 60ffafcdffb8b074c7968dad type: str isBillingTag: description: Whether or not to show the tag as part of billing and invoices sample: true type: bool name: description: The name of the tag. sample: Environment type: str value: description: The value of the tag assigned to the resource. sample: PROD type: str description: The tags assigned if any. returned: always type: list type: description: Server type ID. Cannot be changed once a server is created. returned: always sample: s1.c1.small type: str description: The servers information as list returned: success type: complex