Comments (8)
Hi @Empty2k12 👋🏼
ssh [email protected] sudo /usr/bin/tee
works.
I see you've configured username 'user' for SSH access, but the username argument is not specified in the provider's ssh
config. So the provider is using the default username instead, i.e. the one that is configured in the provider
block via var.PROXMOX_VE_USERNAME
As I see from the the debug log, that user is different, and most likely is not configured for sudo
.
You'd need to add username = "user"
to the ssh
block in the provider config, and everything should work:
ssh {
agent = true
username = "user"
}
Please let me know if it solves the issue.
from terraform-provider-proxmox.
Hello @bpg, thanks for your quick response. I have just renamed the user in this issue. The user is called gero
. Adding username = "gero"
(should not be necessary) does not solve the issue.
Actually, the permissions for the user gero
are broader than required:
gero ALL=(ALL) NOPASSWD: ALL
gero ALL=(root) NOPASSWD: /sbin/pvesm
gero ALL=(root) NOPASSWD: /sbin/qm
gero ALL=(root) NOPASSWD: /usr/bin/tee /var/lib/vz/*
from terraform-provider-proxmox.
Interesting... 🤔 Do you have the same user set up in the same way on all nodes in your PVE cluster?
from terraform-provider-proxmox.
Yes, I have.
from terraform-provider-proxmox.
That really puzzles me. Could you check the syslog on your node, perhaps we can find some clues in there. For example, on my test node I have these logs from the snippet upload:
May 02 20:44:03 pve sshd[1894819]: Accepted key ED25519 SHA256:ciWV4gSYzOwR7dxeBWt/UZq5dF2qXoJOeT8SFQzJFDM found at /home/terraform/.ssh/authorized_keys:1
May 02 20:44:03 pve sshd[1894819]: Accepted publickey for terraform from X.X.X.X port 63876 ssh2: ED25519 SHA256:ciWV4gSYzOwR7dxeBWt/UZq5dF2qXoJOeT8SFQzJFDM
May 02 20:44:03 pve sshd[1894819]: User child is on pid 1894830
May 02 20:44:03 pve sshd[1894830]: Starting session: command for terraform from X.X.X.X port 63876 id 0
May 02 20:44:03 pve sudo[1894833]: terraform : PWD=/home/terraform ; USER=root ; COMMAND=/sbin/pvesm apiinfo
May 02 20:44:03 pve sudo[1894833]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
May 02 20:44:03 pve sudo[1894833]: pam_unix(sudo:session): session closed for user root
May 02 20:44:03 pve sudo[1894837]: terraform : PWD=/home/terraform ; USER=root ; COMMAND=/usr/bin/tee /var/lib/vz/snippets/cloud-config.yaml
May 02 20:44:03 pve sudo[1894837]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
May 02 20:44:03 pve sudo[1894837]: pam_unix(sudo:session): session closed for user root
May 02 20:44:03 pve sshd[1894830]: Close session: user terraform from X.X.X.X port 63876 id 0
Also, what type of shell is configured for root
on your node?
from terraform-provider-proxmox.
I just came across this same problem, and changing my shell back to bash
from zsh
seems to have solved the problem.
I have some pretty custom zsh configs, so I wouldn't be entirely surprised if my issue was there, but I am now curious if the OP was using a shell that isn't bash. 🙂
from terraform-provider-proxmox.
Thank you @mattburchett for your comment!
I faced same issue and yeah..this module is not fully compatible with ZSH.
from terraform-provider-proxmox.
The requirement for the default root
shell has been documented in #1329
from terraform-provider-proxmox.
Related Issues (20)
- Selection of the components you want to be hotpluggable HOT 1
- error creating clonr vm linked clone HOT 6
- Problem with obtain ipv4 addresses for group of nodes HOT 5
- Control the SDN with Terraform HOT 1
- Auto-increase the VM disk size if necessary when provisioning a disk from a `qcow2` image HOT 8
- Proxmox v7.4: Sporadic failure `unable to read tail (got 0 bytes)` on teardown of VMs HOT 3
- VM start fails with large RAM allocation and PCI-E Passthrough HOT 1
- proxmox_virtual_environment_datastores should group attributes in an array scoped to a single datastore HOT 1
- Add an option to create a linked clone of LXC Containers HOT 1
- Missing SPICE options for VMs HOT 1
- proxmox_virtual_environment_download_file new attribute: "path_in_datastore" HOT 2
- proxmox_virtual_environment_vm: cdrom / disk import issue HOT 4
- Error cloning template from shared storage
- Intent to contribute: ISO generation for cloud-init disks HOT 6
- proxmox_virtual_environment_container managing mount_points HOT 7
- Cannot create volume mount point in LXC HOT 7
- Add support for `proxmox_virtual_environment_file` data source HOT 4
- Terraform VM Creation crashes plugin when adding ipv4 configuration to VM HOT 3
- Context Deadline Exceeded only on certain resources HOT 11
- Using Cloud Init package_upgrade: false HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-proxmox.