Skip to main content
Glama

MCP SysOperator

by tarnover
main.yml4.31 kB
--- # Database role tasks # These tasks configure the database servers - name: Install MySQL client package: name: - mysql - mysql-client state: present when: environment != 'localstack' - name: Create database configuration directory file: path: /etc/mysql state: directory owner: root group: root mode: 0755 when: environment != 'localstack' - name: Configure MySQL client template: src: my.cnf.j2 dest: /etc/mysql/my.cnf owner: root group: root mode: 0644 when: environment != 'localstack' - name: Wait for database to be available wait_for: host: "{{ db_cluster_endpoint }}" port: "{{ db_port }}" timeout: 300 delay: 10 when: environment != 'localstack' - name: Create database schema mysql_db: login_host: "{{ db_cluster_endpoint }}" login_user: "{{ db_username }}" login_password: "{{ db_password }}" name: "{{ db_name }}" state: present when: environment != 'localstack' - name: Create database tables mysql_query: login_host: "{{ db_cluster_endpoint }}" login_user: "{{ db_username }}" login_password: "{{ db_password }}" database: "{{ db_name }}" query: | CREATE TABLE IF NOT EXISTS users ( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, email VARCHAR(100) NOT NULL UNIQUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE IF NOT EXISTS posts ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, title VARCHAR(255) NOT NULL, content TEXT NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ); CREATE TABLE IF NOT EXISTS comments ( id INT AUTO_INCREMENT PRIMARY KEY, post_id INT NOT NULL, user_id INT NOT NULL, content TEXT NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ); when: environment != 'localstack' - name: Insert sample data mysql_query: login_host: "{{ db_cluster_endpoint }}" login_user: "{{ db_username }}" login_password: "{{ db_password }}" database: "{{ db_name }}" query: | INSERT IGNORE INTO users (id, username, password, email) VALUES (1, 'admin', '$2y$10$8KGcS0Uw1CW3FuMsXNjU7uHIGK0iKD7jrIJmB7R.WTEkS1PiYlce.', 'admin@example.com'), (2, 'user1', '$2y$10$8KGcS0Uw1CW3FuMsXNjU7uHIGK0iKD7jrIJmB7R.WTEkS1PiYlce.', 'user1@example.com'), (3, 'user2', '$2y$10$8KGcS0Uw1CW3FuMsXNjU7uHIGK0iKD7jrIJmB7R.WTEkS1PiYlce.', 'user2@example.com'); INSERT IGNORE INTO posts (id, user_id, title, content) VALUES (1, 1, 'Welcome to LAMP Stack', 'This is a sample post created by the admin user.'), (2, 2, 'Getting Started with AWS', 'AWS provides a wide range of services for building scalable applications.'), (3, 3, 'Using Ansible for Infrastructure as Code', 'Ansible is a powerful tool for automating infrastructure deployment.'); INSERT IGNORE INTO comments (post_id, user_id, content) VALUES (1, 2, 'Great introduction post!'), (1, 3, 'Looking forward to more content.'), (2, 1, 'AWS is indeed very versatile.'), (3, 2, 'Ansible has made our deployments much easier.'); when: environment != 'localstack' - name: Create database backup script template: src: backup.sh.j2 dest: /usr/local/bin/db-backup.sh owner: root group: root mode: 0755 when: environment != 'localstack' - name: Set up cron job for database backups cron: name: "Database backup" minute: "0" hour: "3" job: "/usr/local/bin/db-backup.sh > /var/log/db-backup.log 2>&1" when: environment != 'localstack' and backup_enabled - name: Create a dummy file for LocalStack testing file: path: /tmp/db-role-applied state: touch mode: 0644 when: environment == 'localstack'

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tarnover/mcp-sysoperator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server