How to create a gitlab ci/cd with ipaserver and ipareplica? #1038
Replies: 15 comments 5 replies
-
the tree of folders and files are from your github
|
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
@awsmaythem I had a hard time having a primary server and a replica on the same host, using containers (still an open issue for me). Along of what @t-woerner wrote, you might want to look at https://github.com/freeipa/freeipa-container on deploying FreeIPA as containers. I'm working on using Vagrant and libvirt virtual machines to deploy a cluster (primary server, one replica, one client) using Github machinery. The current status is "WIP", and code can be found at #1010 |
Beta Was this translation helpful? Give feedback.
-
hi again
the nodes OS is rocky 8.5 is it that the problem? |
Beta Was this translation helpful? Give feedback.
-
the cluster need to be not in containers normal installation is required : |
Beta Was this translation helpful? Give feedback.
-
You may also find something useful here: https://rafaeljeffman.com/projects/freeipa/en/cluster-deployment-ansible.html This was tested with local VMs, both using libvirt and vagrant with libvirt and virtualbox providers. With virtualbox I had a few issues with replica install, as I don't have much experience with it. |
Beta Was this translation helpful? Give feedback.
-
i found why it's giving me error the module on rocky 8.5 is not enabled
i run this command on the node and it's solve the problem
now i need to find why it's stopped on install ipa client |
Beta Was this translation helpful? Give feedback.
-
@rjeffman thanks for the useful link https://rafaeljeffman.com/projects/freeipa/en/cluster-deployment-ansible.html please check if my inventory file (hosts.replica) is correct or not :
with running this command : and i added
because it's always end up on error |
Beta Was this translation helpful? Give feedback.
-
There are two servers in ipaserver, there can only be one initial master server for a domain. |
Beta Was this translation helpful? Give feedback.
-
ok can i set 3 nodes replica to one master and how the inventory be set as? @t-woerner |
Beta Was this translation helpful? Give feedback.
-
ok i added ipaclient and set 1 master node and 1 repilca node
but it's give me and error at :
is this correct? i mean the inventory |
Beta Was this translation helpful? Give feedback.
-
i change the config to much simple inv and edit the playbook
inv :
it's uninstalling the ipa replica |
Beta Was this translation helpful? Give feedback.
-
now it's all working well
and changed back the playbook to present thanks |
Beta Was this translation helpful? Give feedback.
-
now i have a diffrent cluster with 2 nodes 1 master 1 replica it's successfuly replica inv:
|
Beta Was this translation helpful? Give feedback.
-
when installing a new deploy ipaserver the ansible giving an error msg
and i solve it by manual run in vm
can you add
in installation yml file? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hello all,
How can i create a gitlab project about deploy or replica or cluster
because i create with all the settings and inventory files and roles it's not working
for example :
ci/cd file:
`
stages:
deploy:
stage: deploy
image: git.test.local:9000/infra-public/docker-images/ansible:2.9-alpine-3.13
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 400 ~/.ssh
- export ANSIBLE_HOST_KEY_CHECKING=False
- ansible-galaxy collection install freeipa.ansible_freeipa
script:
- ansible-playbook -v -i inventory/hosts.replica install-replica.yml
`
inventory file:
`[ipaserver]
ipa-aws1.test.local
ipa-aws2.test.local
[ipaserver:vars]
ipaadmin_password=test1234
ipadm_password=test1234
ipaserver_domain=test.local
ipaserver_realm=TEST.LOCAL
ipaserver_setup_dns=yes
ipaserver_auto_forwarders=yes
ipaserver_install_packages=no
ipaserver_setup_firewalld=no
ipaserver_ip_addresses=192.168.15.8,192.168.15.9
[ipareplicas]
ipa-aws3r.test.local ipa-aws1.test.local=ipa-aws3r.test.local
ipa-aws4r.test.local ipa-aws2.test.local=ipa-aws4r.test.local
[ipareplicas:vars]
ipaadmin_password=test1234
ipadm_password=test1234
ipaserver_domain=test.local
ipaserver_realm=TEST.LOCAL
ipareplica_install_packages=no
ipareplica_setup_firewalld=no
ipareplica_setup_ca=yes
ipareplica_ip_addresses=192.168.15.10,192.168.15.11
`
but it's failed in pipeline:
Running with gitlab-runner 15.2.1 (32fc1585) on git-runner04 vkCvEtSx Resolving secrets 00:00 Preparing the "docker" executor 00:01 Using Docker executor with image git.test.local:9000/infra-public/docker-images/ansible:2.9-alpine-3.13 ... Authenticating with credentials from job payload (GitLab Registry) Pulling docker image git.elcld.net:9000/infra-public/docker-images/ansible:2.9-alpine-3.13 ... Using docker image sha256:8f592ef26ea171c15d68c43c8018dc33548a98b13561f03b6ae0753539a20fd8 for git.test.local:9000/infra-public/docker-images/ansible:2.9-alpine-3.13 with digest git.elcld.net:9000/infra-public/docker-images/ansible@sha256:66174846605f5f3b6faea1e23a22cec27368741381f4f444c45788a8d4f68742 ... Preparing environment 00:01 Running on runner-vkcvetsx-project-884-concurrent-0 via run4-rhv2.test.local... Getting source from Git repository 00:01 Fetching changes with git depth set to 20... Reinitialized existing Git repository in /builds/amaytham/freeipa/.git/ Checking out 86f72a37 as main... Skipping Git submodules setup Executing "step_script" stage of the job script 00:11 Using docker image sha256:8f592ef26ea171c15d68c43c8018dc33548a98b13561f03b6ae0753539a20fd8 for git.test.local:9000/infra-public/docker-images/ansible:2.9-alpine-3.13 with digest git.elcld.net:9000/infra-public/docker-images/ansible@sha256:66174846605f5f3b6faea1e23a22cec27368741381f4f444c45788a8d4f68742 ... $ eval $(ssh-agent -s) Agent pid 14 $ echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - Identity added: (stdin) ((stdin)) $ mkdir -p ~/.ssh $ chmod 400 ~/.ssh $ export ANSIBLE_HOST_KEY_CHECKING=False $ ansible-galaxy collection install freeipa.ansible_freeipa Process install dependency map |Starting collection install process |Installing 'freeipa.ansible_freeipa:1.9.2' to '/root/.ansible/collections/ansible_collections/freeipa/ansible_freeipa' $ ansible-playbook -v -i inventory/hosts.replica install-replica.yml No config file found; using defaults PLAY [Playbook to configure IPA replicas] ************************************** TASK [Gathering Facts] ********************************************************* ok: [ipa-aws4r.test.local] ok: [ipa-aws3r.test.local] TASK [ipareplica : Import variables specific to distribution] ****************** ok: [ipa-aws3r.test.local] => (item=/builds/amaytham/freeipa/roles/ipareplica/vars/default.yml) => {"ansible_facts": {"ipareplica_packages": ["freeipa-server", "python3-libselinux"], "ipareplica_packages_adtrust": ["freeipa-server-trust-ad"], "ipareplica_packages_dns": ["freeipa-server-dns"], "ipareplica_packages_firewalld": ["firewalld"]}, "ansible_included_var_files": ["/builds/amaytham/freeipa/roles/ipareplica/vars/default.yml"], "ansible_loop_var": "item", "changed": false, "item": "/builds/amaytham/freeipa/roles/ipareplica/vars/default.yml"} ok: [ipa-aws4r.test.local] => (item=/builds/amaytham/freeipa/roles/ipareplica/vars/default.yml) => {"ansible_facts": {"ipareplica_packages": ["freeipa-server", "python3-libselinux"], "ipareplica_packages_adtrust": ["freeipa-server-trust-ad"], "ipareplica_packages_dns": ["freeipa-server-dns"], "ipareplica_packages_firewalld": ["firewalld"]}, "ansible_included_var_files": ["/builds/amaytham/freeipa/roles/ipareplica/vars/default.yml"], "ansible_loop_var": "item", "changed": false, "item": "/builds/amaytham/freeipa/roles/ipareplica/vars/default.yml"} TASK [ipareplica : Install IPA replica] **************************************** included: /builds/amaytham/freeipa/roles/ipareplica/tasks/install.yml for ipa-aws3r.test.local, ipa-aws4r.test.local TASK [ipareplica : Install - Ensure IPA replica packages are installed] ******** skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [ipareplica : Install - Ensure IPA replica packages for dns are installed] *** skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [ipareplica : Install - Ensure IPA replica packages for adtrust are installed] *** skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [ipareplica : Install - Ensure that firewall packages installed] ********** skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [ipareplica : Firewalld service - Ensure that firewalld is running] ******* skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [Firewalld - Verify runtime zone "{{ ipareplica_firewalld_zone }}"] ******* skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [Firewalld - Verify permanent zone "{{ ipareplica_firewalld_zone }}"] ***** skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [Install - Set ipareplica_servers] **************************************** skipping: [ipa-aws3r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [ipa-aws4r.test.local] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [ipareplica : Install - Set default principal if no keytab is given] ****** ok: [ipa-aws3r.test.local] => {"ansible_facts": {"ipaadmin_principal": "admin"}, "changed": false} ok: [ipa-aws4r.test.local] => {"ansible_facts": {"ipaadmin_principal": "admin"}, "changed": false} TASK [ipareplica : Install - Replica installation test] ************************ fatal: [ipa-aws4r.test.local]: FAILED! => {"changed": false, "msg": "No module named 'ipapython'"} fatal: [ipa-aws3r.test.local]: FAILED! => {"changed": false, "msg": "No module named 'ipapython'"} PLAY RECAP ********************************************************************* ipa-aws3r.test.local : ok=4 changed=0 unreachable=0 failed=1 skipped=8 rescued=0 ignored=0 ipa-aws4r.test.local : ok=4 changed=0 unreachable=0 failed=1 skipped=8 rescued=0 ignored=0 Cleaning up project directory and file based variables 00:01 ERROR: Job failed: exit code 2
where did i make a mistake?
Beta Was this translation helpful? Give feedback.
All reactions