0

As the generated inventory look like a pair of instance name - ip (see above), I need to test recipe using the variable ansible_host with an IP value and not the instance name.

So the generated inventory look like:

[all]
idm ansible_host=10.0.1.1
client1 ansible_host=10.0.1.2
[client]
client1 ansible_host=10.0.1.2

Thus the molecule.yml contains:

platforms:
  - name: idm
    image: quay.io/freeipa/freeipa-server:rocky-8-4.9.6
    pre_build_image: true
    privileged: false
    network: testing
    hostname: idm.org.test
    command: ipa-server-install -U --realm=ORG.TEST --domain=org.test --ds-password=IsASecret --admin-password=IsASecret --hostname=idm.org.test

  - name: client1
    image: quay.io/rockylinux/rockylinux
    pre_build_image: true
    privileged: false
    network: testing
    hostname: client1.org.test
    groups:
      - all
      - client

Following this configuration I am able to put into the same network these 2 instances but I can not assign a static IP to them. Moreover here, ansible_host take the instance name as value (idm, client1).

Note: as it is wrote in title I use molecule-podman to create instances and test

Thanks for your help

Best regards

bioinfornatics
  • 166
  • 1
  • 7

1 Answers1

0

If you need static IP (you could use dns BTW but you probably already know that since your client seem to use idm.org.test) I think that you have to use your own create.yml file based on https://github.com/ansible-community/molecule-podman/blob/main/src/molecule_podman/playbooks/create.yml to do such a thing.

Because my understanding is that you can not control lots of parameter when the network is created by podman.

faust
  • 1