southalc / podman

Puppet module for podman
Apache License 2.0
13 stars 30 forks source link

network create not working #62

Closed doctorpalomo closed 1 year ago

doctorpalomo commented 1 year ago

Hi, I have this code

include podman

$user = 'podman'
$user_home = "/var/lib/${user}"

  group { $user:
    ensure => present,
    gid    => '60000'
  }

  user { $user:
    ensure   => present,
    shell    => '/bin/bash',
    uid      => '60000',
    gid      => '60000',
    home     => $user_home,
    require    => Group[$user]
  } 

  file { 'home_user':
    ensure => directory,
    path   => $user_home,
    mode   => '0755',
    owner  => $user,
    group  => $user,
  }

  podman::rootless { $user: }

  podman::subuid { $user:
    subuid => 255666,
    count  => 65535,
   }

  podman::subgid { $user:
    subgid => 255666,
    count  => 65535,
  }

  podman::network { 'mynetwork':
    user     => $user,
    driver   => 'bridge',
    internal => true,
  }

But when I run puppet, I have an error with this description:

Error: /Stage[main]/Podman_all::Configure/Podman::Network[mynetwork]/Exec[podman_create_network_mynetwork]/returns: change from 'notrun' to ['0'] failed: 'podman network create mynetwork --driver bridge     --internal    
' returned 1 instead of one of [0]

Please, can you help me? Thanks.

southalc commented 1 year ago

To debug this, login to the target host, "su" to podman, set the XDG_RUNTIME_DIR, and manually run the command being run by puppet. This should show the error and we can determine what to do next.

$ su - podman $ export XDG_RUNTIME_DIR=/run/user/$(id -u)

$ podman network create mynetwork --driver bridge --internal

On Fri, Jun 2, 2023, 7:00 AM DoctorPalomo @.***> wrote:

Hi, I have this code

`include podman

$user = 'podman' $user_home = "/var/lib/${user}"

group { $user: ensure => present, gid => '60000' }

user { $user: ensure => present, shell => '/bin/bash', uid => '60000', gid => '60000', home => $user_home, require => Group[$user] }

file { 'home_user': ensure => directory, path => $user_home, mode => '0755', owner => $user, group => $user, }

podman::rootless { $user: }

podman::subuid { $user: subuid => 255666, count => 65535, }

podman::subgid { $user: subgid => 255666, count => 65535, }

podman::network { 'mynetwork': user => $user, driver => 'bridge', internal => true, } `

But when I run puppet, I have an error with this description:

Error: /Stage[main]/Podman_all::Configure/Podman::Network[mynetwork]/Exec[podman_create_network_mynetwork]/returns: change from 'notrun' to ['0'] failed: 'podman network create mynetwork --driver bridge --internal ' returned 1 instead of one of [0]

Please, can you help me? Thanks.

— Reply to this email directly, view it on GitHub https://github.com/southalc/podman/issues/62, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI3XBISFM2TS7WGTBV6ZSHDXJHBUHANCNFSM6AAAAAAYYFCWBA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

doctorpalomo commented 1 year ago

After clean installation.. now it's works. Thanks!