浏览代码

add Readme

Sassan 3 年之前
父节点
当前提交
d580394d19
共有 2 个文件被更改,包括 44 次插入3 次删除
  1. 4 3
      Makefile
  2. 40 0
      README.md

+ 4 - 3
Makefile

@@ -4,9 +4,6 @@ check:
 	@echo yaml module  $(pythonReq)
 
 
-all:
-	@echo Hello
-
 
 
 verify:
@@ -20,6 +17,10 @@ install:
 	echo "#yaml2fstab" >> /tmp/fstab
 
 
+parse:
+	./yaml2fstab.py
+
+
 clean:
 	sed -i  '/#yaml2fstab/,/#yaml2fstab/{//!d}' /tmp/fstab
 	rm /tmp/mnt

+ 40 - 0
README.md

@@ -0,0 +1,40 @@
+# YAML to fstab
+## It's Challenge for Platform Engineering  of Adjust company
+
+
+It a python script to convert yaml file to fstab compatible format
+
+
+## Features
+
+- Verify file before fstab modification
+- Clean modified data from fstab
+- Add parsed data to fstab
+- Parse yaml from yaml file
+
+
+
+
+## Install
+this script required python3 and pyyaml
+- CentOS/RHEL:
+    -  `yum install PyYAML`
+- Debian/Ubuntu:
+    - `apt insatll python3-yaml`
+- pipe:
+    - `pip3 install pyyaml`  
+
+##### Note: change `/tmp/fstab` to `/etc/fstab` in main script 
+
+
+## Usage
+- put yaml file next to yaml2fstab.py
+- run `make check` to verify requirements before running
+- run `make parse` to see parsed data
+- run ` make verify` to verify parsed data before installing you should see `0 parse errors` to ensure everything is OK.
+- run `make install` to add parsed data to /etc/fstab
+
+
+## Uninstall
+- run `make uninstall` to remove modifications made by this script from `/etc/fstab` 
+