Initial main commit

This commit is contained in:
Dak Thompson 2024-07-11 16:02:19 -05:00
commit 7c92db12bc
10 changed files with 170 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MaterialThemeProjectNewConfig">
<option name="metadata">
<MTProjectMetadataState>
<option name="userId" value="-247ead6e:190a3356b8f:-7fef" />
</MTProjectMetadataState>
</option>
</component>
</project>

6
.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/homelab_postgres.iml" filepath="$PROJECT_DIR$/homelab_postgres.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

84
.idea/workspace.xml Normal file
View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="5549501c-8c1d-4350-b038-9b1c0bfbb0e1" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.idea/material_theme_project_new.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/homelab_postgres.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/hosts.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/roles/postgresql/tasks/main.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/run.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/site.yml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ComposerSettings">
<execution />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectCodeStyleSettingsMigration">
<option name="version" value="2" />
</component>
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 2
}]]></component>
<component name="ProjectId" id="2j75DONh9LLWTaTYqQ4UqLchJnb" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "main",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "/home/dagmatto/homelab_postgres",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/roles" />
</key>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-b114ca120d71-intellij.indexing.shared.core-IU-242.19890.14" />
<option value="bundled-js-predefined-d6986cc7102b-eef0733dfcaf-JavaScript-IU-242.19890.14" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="5549501c-8c1d-4350-b038-9b1c0bfbb0e1" name="Changes" comment="" />
<created>1720725158361</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1720725158361</updated>
<workItem from="1720725160671" duration="2403000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

8
homelab_postgres.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="GENERAL_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

9
hosts.yml Normal file
View File

@ -0,0 +1,9 @@
---
all:
hosts:
server1:
ansible_become_pass: "{{ server1_become_pass }}"
server2:
ansible_become_pass: "{{ server2_become_pass }}"
vars:
ansible_user: zoe

View File

@ -0,0 +1,31 @@
---
- name: Install PostgreSQL
become: yes
zypper:
name: "{{item}}"
state: latest
loop:
- postgresql
- postgresql-server
- postgresql-contrib
- postgresql-devel
- python3-psycopg2
- name: Turn on Postgres server
become: yes
systemd:
name: postgresql
enabled: yes
state: restarted
- name: Update pg_hba conf
become: yes
postgresql_pg_hba:
contype: local
dest: /var/lib/pgsql/data/pg_hba.conf
method: trust
users: postgres
state: present
- name: Reload postgres
become: yes
systemd:
name: postgresql
state: reloaded

3
run.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
ansible-playbook -i hosts.yml site.yml --vault-password-file ~/.vault_pass.txt

5
site.yml Normal file
View File

@ -0,0 +1,5 @@
---
- name: Setup TeamCity
hosts: server2
roles:
- role: postgresql