1

We in the middle to developed molecule testing using Vagrant as driver and libvirt as provider.

However, the VM that Vagrant create from molecule use user 'vagrant' to perform validation or installation inside the VM. We plan to use 'root' user instead of default user as 'vagrant'

We try to include below option in molecule.yml,

---
dependency:
  name: galaxy
driver:
  name: vagrant
  provider:
    name: libvirt
    type: libvirt
    options:
      memory: 192
      cpus: 1
  ssh_user: root
  ssh_password: 'xxxxxxx'
platforms:
  - name: test-vm
    box: centos7
    interfaces:
      - auto_config: true
        network_name: private_network
        type: static
        ip: 192.168.122.100
    config_options:
      ssh.remote_user: "'root'"

We try to search for details options that molecule.yml can use inside from molecule site but not able to found it.

Thus, the issue currently is:

  • Molecule use 'vagrant' user instead of root to perform any playbook tasks.
  • When login manually into the Vagrant VM using 'vagrant ssh' , it directly login as user 'vagrant' instead of 'root'

Need assistance from expertise for this kind of issue.

MrAZ
  • 394
  • 3
  • 13

0 Answers0