Create VM with Vagrant and configure Jenkins with Ansible
- Vagrant
- Ansible: sudo apt update && sudo apt install -y ansible
- Ansible
jenkinsrole fromgeerlingguyinstalled:ansible-galaxy install geerlingguy.jenkins. Confirmansible-galaxy list. I have it calledansible-role-jenkins. If your local role name differs, make sure you define it accordingly injenkins.yaml.
Initiate provisioning running vagrant up.
-
If Vagrantfile specifies provisioning with bash script (here, the default one), the script will run and install&configure Jenkins.
-
If Vagrantfile has defined provisioning
ansible, once VM is provisioned, ansible role for Jenkins installation is triggered.
When Jenkins configuration is completed, the initial admin passwordpassword output will be displayed.