This little snippet shows you how to create roles programmatically in Drupal 7.
Source code viewer$some_role = new stdClass();$some_role->name = 'role';user_role_save($some_role);Programming Language: PHP