Skip to content

Commit bad7450

Browse files
committed
updated README.md
1 parent 1e7e90c commit bad7450

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ A Python script to sync Microsoft Intune managed devices into Snipe-IT, with the
3131
cd intune-snipe-sync
3232
```
3333
2. Install dependencies:
34+
```bash
35+
pip install -r requirements.txt
36+
```
37+
Or install manually:
3438
```bash
3539
pip install msal requests
3640
```
@@ -95,6 +99,54 @@ python3 app.py --platform windows --groups "<group-object-id-1>,<group-object-id
9599

96100
**Note:** Group filtering requires devices to be Azure AD registered/joined. Devices that are only Intune-managed without Azure AD registration will not be matched.
97101

102+
## Deployment
103+
104+
This project includes a `Dockerfile` and Kubernetes manifest (`k8s/cronjob.yaml`) that you can use to automate the sync process. **It's recommended to test the script directly using Python first**, and once you've verified it works correctly, deploy it using Docker or Kubernetes.
105+
106+
### Docker
107+
108+
Build and run the Docker container:
109+
110+
```bash
111+
# Build the image
112+
docker build -t intune2snipe:latest .
113+
114+
# Run the container
115+
docker run --rm \
116+
-e AZURE_TENANT_ID="<your-tenant-id>" \
117+
-e AZURE_CLIENT_ID="<your-client-id>" \
118+
-e AZURE_CLIENT_SECRET="<your-client-secret>" \
119+
-e SNIPEIT_URL="<your-snipeit-url>" \
120+
-e SNIPEIT_API_TOKEN="<your-token>" \
121+
intune2snipe:latest \
122+
--platform windows --dry-run
123+
```
124+
125+
### Kubernetes
126+
127+
The Kubernetes manifest includes a CronJob that runs the sync on a schedule (default: daily at 2:00 AM UTC).
128+
129+
1. **Edit the Kubernetes manifest** (`k8s/cronjob.yaml`):
130+
- Update the Secret values with your actual credentials
131+
- Update the image name to match your container registry
132+
- Customize the schedule if needed (cron format)
133+
- Adjust resource limits if necessary
134+
135+
2. **Apply the manifest**:
136+
```bash
137+
kubectl apply -f k8s/cronjob.yaml
138+
```
139+
140+
3. **Check the CronJob status**:
141+
```bash
142+
kubectl get cronjob intune2snipe-sync
143+
kubectl get jobs -l app=intune2snipe-sync
144+
```
145+
146+
### GitHub Actions
147+
148+
The repository includes a GitHub Actions workflow (`.github/workflows/docker-build.yml`) that automatically builds and pushes Docker images to GitHub Container Registry (ghcr.io) on push to main/master branches. Update the image name in the Kubernetes manifest to match your repository path.
149+
98150
## How it works
99151

100152
1. **Fetch** Azure AD device IDs from specified groups (if `--groups` or `AZURE_GROUP_IDS` is set).

0 commit comments

Comments
 (0)