Skip to content

Commit fce06b1

Browse files
authored
feat(proxmox_lxc)!: remove storage option (#19)
1 parent e416c20 commit fce06b1

File tree

3 files changed

+23
-35
lines changed

3 files changed

+23
-35
lines changed

roles/proxmox_lxc/README.md

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
bellackn.proxmox_lxc
2-
===============
1+
# bellackn.proxmox_lxc
32

43
> This role used to be called bellackn.px_lxc and was renamed as part of [#1](https://github.com/bellackn/ansible-role-proxmox-lxc/issues/1).
54
65
This role is a convenient wrapper for the Ansible Proxmox community module and can be used to create or delete LXCs on a
76
Proxmox instance.
87

9-
How to Use
10-
----------
8+
## How to Use
119

1210
The role bases upon the `proxmox_lxc_containers_present` and `proxmox_lxc_containers_absent` variables to
13-
spawn or delete LXCs. You can put a list of LXCs into these variables; the list items use the same keys like the
11+
spawn or delete LXCs. You can put a list of LXCs into these variables; the list items use the same keys like the
1412
[Proxmox community module][1]. There are a lot of sane default values for most of the possible settings, but you can
1513
override each of them, either on a global level by overriding the default `proxmox_lxc_*` variable, or for a specific
16-
container by passing the variable into `proxmox_lxc_containers_present` - just check the example playbook (the `cpus`
14+
container by passing the variable into `proxmox_lxc_containers_present` - just check the example playbook (the `cpus`
1715
part) and you'll get the idea.
1816

19-
Requirements
20-
------------
17+
## Requirements
2118

2219
You need to have the following installed on your controlhost:
23-
* Ansible Role `geerlingguy.pip`
24-
* Dependency to ensure that `pip` is present to install the required `proxmoxer` package
25-
* Ansible Collection `community.general`
26-
* Contains the `community.general.proxmox` module, the centerpiece of this role
2720

28-
Role Variables
29-
--------------
21+
- Ansible Role `geerlingguy.pip`
22+
- Dependency to ensure that `pip` is present to install the required `proxmoxer` package
23+
- Ansible Collection `community.general`
24+
- Contains the `community.general.proxmox` module, the centerpiece of this role
25+
26+
## Role Variables
3027

3128
### Mandatory
3229

@@ -64,7 +61,7 @@ need the logs for debugging though. Set this to `false` then.
6461
proxmox_lxc_containers_present: []
6562
proxmox_lxc_containers_absent: []
6663

67-
Takes a list of LXCs that you either want to **create** or to **delete**. See the [Proxmox community module][1] for all
64+
Takes a list of LXCs that you either want to **create** or to **delete**. See the [Proxmox community module][1] for all
6865
possible variables and check the example playbook. For the absent container list, passing the hostname is enough.
6966

7067
(Although these are optional, not defining any of them makes the role pretty much pointless.)
@@ -84,7 +81,7 @@ that it has within the Proxmox cluster (see [#4](https://github.com/bellackn/ans
8481
proxmox_lxc_cpus: 1
8582
proxmox_lxc_cpuunits: 1000
8683
proxmox_lxc_description: Created with Ansible
87-
proxmox_lxc_disk: 3
84+
proxmox_lxc_disk: local-lvm:3
8885
proxmox_lxc_features: []
8986
proxmox_lxc_force: no
9087
proxmox_lxc_hookscript: ""
@@ -95,7 +92,6 @@ that it has within the Proxmox cluster (see [#4](https://github.com/bellackn/ans
9592
proxmox_lxc_pool: ""
9693
proxmox_lxc_pubkey: ""
9794
proxmox_lxc_searchdomain: ""
98-
proxmox_lxc_storage: local
9995
proxmox_lxc_swap: 0
10096
proxmox_lxc_timeout: 30
10197
proxmox_lxc_unprivileged: no
@@ -125,8 +121,7 @@ Seconds to wait for the LXC to be started.
125121
You can specify the VMID for the container that you want to create. If you don't set this, the next available ID will
126122
be automatically picked. If the specified ID is already taken, the play will fail.
127123

128-
Example Playbook
129-
----------------
124+
## Example Playbook
130125

131126
This playbook will create two Ubuntu LXCs and delete them afterwards.
132127

@@ -139,7 +134,6 @@ This playbook will create two Ubuntu LXCs and delete them afterwards.
139134
proxmox_lxc_api_host: proxmox
140135
proxmox_lxc_api_user: root@pam
141136
proxmox_lxc_api_password: s3cr3t!
142-
proxmox_lxc_storage: local-lvm
143137
proxmox_lxc_cpus: 2 # Specify the value for all LXCs created with this role
144138

145139
proxmox_lxc_containers_present:
@@ -153,32 +147,28 @@ This playbook will create two Ubuntu LXCs and delete them afterwards.
153147
cpus: 2 # Use a value specifically for this LXC
154148
ostemplate: local:vztmpl/ubuntu-20.04-standard_20.04-1_amd64.tar.gz
155149
password: baaar
156-
150+
157151
proxmox_lxc_containers_absent:
158152
- hostname: test1
159153
- hostname: test2
160-
154+
161155
roles:
162156
- bellackn.homelab.proxmox_lxc
163157

164-
Known Limitations
165-
-----------------
158+
## Known Limitations
166159

167-
* It's currently not possible to authenticate with Proxmox using API tokens, you have to use user/password.
168-
* Deleting containers must happen by specifying its hostname, deleting by VMID is not yet possible.
160+
- It's not possible to authenticate with Proxmox using API tokens, you have to use user/password.
161+
- Deleting containers must happen by specifying its hostname, deleting by VMID is not possible.
169162

170-
License
171-
-------
163+
## License
172164

173165
MIT
174166

175-
Author Information
176-
------------------
167+
## Author Information
177168

178169
[Nico Bellack](mailto:[email protected])
179170

180-
Acknowledgements
181-
----------------
171+
## Acknowledgements
182172

183173
This role was heavily inspired by the [ovv.lxc](https://github.com/ovv/ansible-role-proxmox-lxc) role. Thank you!
184174

roles/proxmox_lxc/defaults/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ proxmox_lxc_cores: 1
1515
proxmox_lxc_cpus: 1
1616
proxmox_lxc_cpuunits: 1000
1717
proxmox_lxc_description: Created with Ansible
18-
proxmox_lxc_disk: 3
18+
proxmox_lxc_disk: local-lvm:3
1919
proxmox_lxc_features: []
2020
proxmox_lxc_force: false
2121
proxmox_lxc_hookscript: ""
@@ -28,7 +28,6 @@ proxmox_lxc_password: "" # Minimum length is 5
2828
proxmox_lxc_pool: ""
2929
proxmox_lxc_pubkey: ""
3030
proxmox_lxc_searchdomain: ""
31-
proxmox_lxc_storage: local
3231
proxmox_lxc_swap: 0
3332
proxmox_lxc_timeout: 30
3433
proxmox_lxc_unprivileged: false

roles/proxmox_lxc/tasks/create_lxc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
pubkey: "{{ item.pubkey | default(proxmox_lxc_pubkey) }}"
3434
searchdomain: "{{ item.searchdomain | default(proxmox_lxc_searchdomain) }}"
3535
state: present
36-
storage: "{{ item.storage | default(proxmox_lxc_storage) }}"
3736
swap: "{{ item.swap | default(proxmox_lxc_swap) }}"
3837
timeout: "{{ item.timeout | default(proxmox_lxc_timeout) }}"
3938
validate_certs: "{{ item.validate_certs | default(proxmox_lxc_validate_certs) }}"

0 commit comments

Comments
 (0)