8000 Fix for cases when PyInfra escapes chars unreliably · unkn0wnAPI/sysadmin-scripts@9e2ff31 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e2ff31

Browse files
committed
Fix for cases when PyInfra escapes chars unreliably
1 parent de4f516 commit 9e2ff31

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Universal/PyInfra/ArchServer/deploy.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,22 +217,21 @@ def system_services():
217217
)
218218

219219
@deploy("Post-deployment Tasks")
220-
def session_cleanup():
220+
def deployment_cleanup():
221221
server.shell(
222222
name = "Removing sudo bypass",
223223
commands = [f"sed -i '/NOPASSWD/d' /etc/sudoers"],
224224
_sudo = True
225225
)
226226

227-
server.shell(
228-
name = "Removing `paru-src` leftovers",
229-
commands = [f"rm /home/{host.get_fact(User)}/paru -r"],
230-
_sudo = True
231-
)
232-
233227
server.shell(
234228
name = "Adding hostname & IP to login screen",
235-
commands = ["echo -e 'Hostname: \\n \nIPv4: \4\n' >> /etc/issue"], # not tested be careful, it should work
229+
commands = [
230+
"echo '===SERVER INFORMATION===' >> /etc/issue",
231+
'printf "Hostname: \\cdx" >> /etc/issue',
232+
"echo -e '\nIPv4: \\4\n' >> /etc/issue",
233+
"sed -i 's/cdx/n/' /etc/issue"
234+
],
236235
_sudo = True
237236
)
238237

@@ -247,8 +246,7 @@ def main():
247246
user_configuration()
248247
system_services()
249248
service_configuration()
250-
edit_files()
251-
session_cleanup()
249+
deployment_cleanup()
252250

253251
#
254252
## Init Point

0 commit comments

Comments
 (0)
0