Skip to content

Commit 27178f4

Browse files
committed
Orbstack profile
1 parent 8ee79cc commit 27178f4

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
- hosts: localhost
3+
gather_facts: false
4+
5+
pre_tasks:
6+
- name: Set the required variables
7+
set_fact:
8+
ingest_token: "{{ lookup('env','ACCESS_TOKEN') }}"
9+
rum_token: "{{ lookup('env','RUM_TOKEN') }}"
10+
realm: "{{ lookup('env','REALM') }}"
11+
instance: "{{ lookup('env','INSTANCE') }}"
12+
hec_url: "{{ lookup('env','HEC_URL') }}"
13+
hec_token: "{{ lookup('env','HEC_TOKEN') }}"
14+
15+
tasks:
16+
- name: Configure Orbstack
17+
block:
18+
- name: Check to see if the config has run
19+
stat:
20+
path: /blue_rabbit.followed
21+
register: wh_result
22+
23+
- name: Add environment variables to .profile
24+
ansible.builtin.blockinfile:
25+
path: /etc/skel/.profile
26+
block: |
27+
export REALM={{ realm }}
28+
export ACCESS_TOKEN={{ ingest_token }}
29+
export RUM_TOKEN={{ rum_token }}
30+
export HEC_TOKEN={{ hec_token }}
31+
export HEC_URL={{ hec_url }}
32+
export INSTANCE={{ instance }}
33+
become: true
34+
when: not wh_result.stat.exists
35+
36+
- name: Create a file to signify that the config has run successfully
37+
file:
38+
path: "/blue_rabbit.followed"
39+
state: touch
40+
become: true
41+
when: not wh_result.stat.exists

0 commit comments

Comments
 (0)