-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.yml
47 lines (47 loc) · 1.88 KB
/
installer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
parameters:
- name: host
type: string
resources:
repositories:
- repository: inventory
type: github
name: JamesJonesConsulting/AnsibleInventory
endpoint: JamesJonesConsulting
- repository: vault
type: github
name: JamesJonesConsulting/AnsibleVault
endpoint: JamesJonesConsulting
containers:
- container: podman-dind
image: registry.gitlab.com/jamesjonesconsulting/podman-dind-like:latest
endpoint: JamesJonesConsultingDockerGitlab
options: --userns=keep-id --privileged --user root
# mapDockerSocket: false
jobs:
- deployment: azure_devops_agent_deployment
displayName: Azure DevOps Agent Deployment
pool: FedoraHosted
environment: GitLab
container: podman-dind
variables:
- group: Connections
strategy:
runOnce:
deploy:
steps:
- checkout: self
path: s/pipeline
- checkout: inventory
path: s/inventory
- checkout: vault
path: s/vault
- bash: |
eval $(ssh-agent); ssh-add <(echo "${SSH_KEY}" | base64 -d);
echo -n "${VAULT_KEY}" | base64 -d > $(Agent.TempDirectory)/.vault
ansible-galaxy collection install -r ansible/requirements.yml -f
ansible-playbook -i $(Build.SourcesDirectory)/inventory/home/hosts --vault-password-file $(Agent.TempDirectory)/.vault ansible/playbook.yml --extra-vars 'host_or_group=${{ parameters.host }} token=$(vsts_agent_install_token) vsts_agent_vaulted_variables=$(Build.SourcesDirectory)/vault/home/vsts-agent/vsts-agent.yml' -b
workingDirectory: $(Build.SourcesDirectory)/pipeline
displayName: Connect to host and setup Azure DevOps agent with Podman
env:
SSH_KEY: $(default_ssh_key)
VAULT_KEY: $(ansible_vault_key)